mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-18 10:59:10 +08:00
fix(popper): revert appendToBody from false to true (#845)
This commit is contained in:
parent
ef35578a32
commit
99dbe0e233
@ -76,11 +76,11 @@ describe('Autocomplete.vue', () => {
|
||||
const wrapper = _mount()
|
||||
|
||||
await wrapper.setProps({ popperClass: 'error' })
|
||||
expect(wrapper.find('.el-popper').classes('error')).toBe(true)
|
||||
expect(document.body.querySelector('.el-popper').classList.contains('error')).toBe(true)
|
||||
|
||||
await wrapper.setProps({ popperClass: 'success' })
|
||||
expect(wrapper.find('.el-popper').classes('error')).toBe(false)
|
||||
expect(wrapper.find('.el-popper').classes('success')).toBe(true)
|
||||
expect(document.body.querySelector('.el-popper').classList.contains('error')).toBe(false)
|
||||
expect(document.body.querySelector('.el-popper').classList.contains('success')).toBe(true)
|
||||
})
|
||||
|
||||
test('popperAppendToBody', async () => {
|
||||
|
@ -155,7 +155,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
popperAppendToBody: Boolean,
|
||||
popperAppendToBody: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
highlightFirstItem: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
@ -309,11 +309,11 @@ describe('Cascader.vue', () => {
|
||||
})
|
||||
|
||||
const input = wrapper.find('input')
|
||||
const dropdown = wrapper.find(DROPDOWN)
|
||||
const dropdown = document.querySelector(DROPDOWN)
|
||||
input.element.value = 'ha'
|
||||
await input.trigger('input')
|
||||
const hzSuggestion = dropdown.find(SUGGESTION_ITEM)
|
||||
const hzSuggestion = dropdown.querySelector(SUGGESTION_ITEM) as HTMLElement
|
||||
expect(filterMethod).toBeCalled()
|
||||
expect(hzSuggestion.text()).toBe('Zhejiang / Hangzhou')
|
||||
expect(hzSuggestion.textContent).toBe('Zhejiang / Hangzhou')
|
||||
})
|
||||
})
|
||||
|
@ -210,8 +210,8 @@ describe('click pager', () => {
|
||||
},
|
||||
})
|
||||
|
||||
const items = wrapper.findAll('.el-select-dropdown__item:not(.selected)')
|
||||
await items[0].trigger('click')
|
||||
const items = document.querySelectorAll('.el-select-dropdown__item:not(.selected)');
|
||||
(items[0] as HTMLOptionElement)?.click()
|
||||
expect(onSizeChange).toHaveBeenCalled()
|
||||
expect(wrapper.findComponent(Pagination).emitted()).toHaveProperty('size-change')
|
||||
})
|
||||
|
@ -82,7 +82,7 @@ describe('Popper.vue', () => {
|
||||
|
||||
test('append to body', () => {
|
||||
let wrapper = _mount()
|
||||
expect(wrapper.find(selector).exists()).toBe(true)
|
||||
expect(wrapper.find(selector).exists()).toBe(false)
|
||||
|
||||
/**
|
||||
* Current layout of `ElPopper`
|
||||
@ -93,14 +93,16 @@ describe('Popper.vue', () => {
|
||||
*/
|
||||
|
||||
wrapper = _mount({
|
||||
appendToBody: true,
|
||||
appendToBody: false,
|
||||
})
|
||||
|
||||
expect(wrapper.find(selector).exists()).toBe(false)
|
||||
expect(wrapper.find(selector).exists()).toBe(true)
|
||||
})
|
||||
|
||||
test('popper z-index should be dynamical', () => {
|
||||
const wrapper = _mount()
|
||||
const wrapper = _mount({
|
||||
appendToBody: false,
|
||||
})
|
||||
|
||||
expect(
|
||||
Number.parseInt(
|
||||
@ -151,6 +153,7 @@ describe('Popper.vue', () => {
|
||||
document.addEventListener('mousedown', onMouseDown)
|
||||
|
||||
const wrapper = _mount({
|
||||
appendToBody: false,
|
||||
stopPopperMouseEvent: false,
|
||||
visible: true,
|
||||
})
|
||||
|
@ -48,7 +48,7 @@ export default {
|
||||
},
|
||||
appendToBody: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: true,
|
||||
},
|
||||
boundariesPadding: {
|
||||
type: Number,
|
||||
|
@ -243,7 +243,10 @@ export default defineComponent({
|
||||
default: 'value',
|
||||
},
|
||||
collapseTags: Boolean,
|
||||
popperAppendToBody: Boolean,
|
||||
popperAppendToBody: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
clearIcon: {
|
||||
type: String,
|
||||
default: 'el-icon-circle-close',
|
||||
|
Loading…
Reference in New Issue
Block a user