mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
fix(components): [select] style error in multiple collapseTags (#14602)
This commit is contained in:
parent
dfad5539f5
commit
4580aea8e4
@ -1058,12 +1058,15 @@ describe('Select', () => {
|
||||
selectWrapper.vm.handleResize()
|
||||
options[0].click()
|
||||
await nextTick()
|
||||
const tagWrappers = wrapper.findAll('.el-select__tags-text')
|
||||
const tagWrapperDom = tagWrappers[0].element
|
||||
expect(Number.parseInt(tagWrapperDom.style.maxWidth) === 200 - 75).toBe(
|
||||
true
|
||||
)
|
||||
options[1].click()
|
||||
await nextTick()
|
||||
options[2].click()
|
||||
await nextTick()
|
||||
const tagWrappers = wrapper.findAll('.el-select__tags-text')
|
||||
const tagWrapperDom = tagWrappers[0].element
|
||||
expect(Number.parseInt(tagWrapperDom.style.maxWidth) === 200 - 123).toBe(
|
||||
true
|
||||
)
|
||||
|
@ -693,7 +693,8 @@ export default defineComponent({
|
||||
|
||||
const tagTextStyle = computed(() => {
|
||||
const maxWidth =
|
||||
unref(inputWidth) > 123
|
||||
unref(inputWidth) > 123 &&
|
||||
unref(selected).length > props.maxCollapseTags
|
||||
? unref(inputWidth) - 123
|
||||
: unref(inputWidth) - 75
|
||||
return { maxWidth: `${maxWidth}px` }
|
||||
|
Loading…
Reference in New Issue
Block a user