mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-03 11:47:48 +08:00
fix(components): [select] not set input padding anymore (#7269)
This commit is contained in:
parent
1ebafe7bbe
commit
de29873f40
@ -543,27 +543,16 @@ export default defineComponent({
|
||||
resetInputHeight()
|
||||
}
|
||||
nextTick(() => {
|
||||
if (!reference.value) return
|
||||
if (reference.value.$el) {
|
||||
inputWidth.value = reference.value.$el.getBoundingClientRect().width
|
||||
}
|
||||
const refEl = reference.value && reference.value.$el
|
||||
if (!refEl) return
|
||||
inputWidth.value = refEl.getBoundingClientRect().width
|
||||
|
||||
if (ctx.slots.prefix) {
|
||||
const inputChildNodes = reference.value.$el.childNodes
|
||||
const input = (Array.from(inputChildNodes) as HTMLElement[]).find(
|
||||
(item) => item.tagName === 'INPUT'
|
||||
const prefix = refEl.querySelector(`.${nsInput.e('prefix')}`)
|
||||
prefixWidth.value = Math.max(
|
||||
prefix.getBoundingClientRect().width + 5,
|
||||
30
|
||||
)
|
||||
if (input) {
|
||||
const prefix = reference.value.$el.querySelector(
|
||||
`.${nsInput.e('prefix')}`
|
||||
)
|
||||
prefixWidth.value = Math.max(
|
||||
prefix.getBoundingClientRect().width + 5,
|
||||
30
|
||||
)
|
||||
if (states.prefixWidth) {
|
||||
input.style.paddingLeft = `${Math.max(states.prefixWidth, 30)}px`
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
setSelected()
|
||||
|
Loading…
Reference in New Issue
Block a user