diff --git a/packages/dropdown/__tests__/dropdown.spec.tsx b/packages/dropdown/__tests__/dropdown.spec.tsx index bda1789e2e..3e68b4c6ff 100644 --- a/packages/dropdown/__tests__/dropdown.spec.tsx +++ b/packages/dropdown/__tests__/dropdown.spec.tsx @@ -313,6 +313,30 @@ describe('Dropdown', () => { }) await sleep(TIMEOUT) expect(wrapper.findComponent({ ref: 'd' }).attributes('tabindex')).toBe('0') + }) + test('max height', async () => { + const wrapper = _mount( + ` + + + dropdown + + + + `, + () => ({}), + ) + const content = wrapper.findComponent({ ref: 'b' }) + const scrollbar = content.findComponent({ ref: 'scrollbar' }) + expect(scrollbar.find('.el-scrollbar__wrap').attributes('style')).toContain('max-height: 60px;') }) }) diff --git a/packages/dropdown/src/dropdown.vue b/packages/dropdown/src/dropdown.vue index c178f1c813..b47f2144ed 100644 --- a/packages/dropdown/src/dropdown.vue +++ b/packages/dropdown/src/dropdown.vue @@ -14,11 +14,18 @@ :gpu-acceleration="false" >