fix(components): [select] correct update selectSize (#11973)

* chore: 尝试恢复pr

* chore: update

* chore: update
This commit is contained in:
acyza 2023-04-23 15:12:46 +08:00 committed by GitHub
parent 105d79b0d9
commit 4c93b47a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -2048,6 +2048,12 @@ describe('Select', () => {
},
})
Object.defineProperty(inputEl, 'clientHeight', {
get() {
return Number.parseInt(getComputedStyle(inputEl).height)
},
})
for (const size in sizeMap) {
await wrapper.setProps({
size,

View File

@ -383,7 +383,9 @@ export const useSelect = (props, states: States, ctx) => {
const gotSize = getComponentSize(selectSize.value || form?.size)
const sizeInMap =
gotSize === originClientHeight || originClientHeight <= 0
selectSize.value ||
gotSize === originClientHeight ||
originClientHeight <= 0
? gotSize
: originClientHeight