fix(components): [select-v2] option need double click in IOS (#20041)

* fix(components): [select-v2] option need double click in IOS

* chore: format
This commit is contained in:
sea 2025-03-07 11:13:07 +08:00 committed by GitHub
parent d4bb395291
commit 434208c9ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,7 @@ import {
watch,
} from 'vue'
import { get } from 'lodash-unified'
import { isObject, isUndefined } from '@element-plus/utils'
import { isIOS, isObject, isUndefined } from '@element-plus/utils'
import {
DynamicSizeList,
FixedSizeList,
@ -253,6 +253,10 @@ export default defineComponent({
return () => {
const { data, width } = props
const { height, multiple, scrollbarAlwaysOn } = select.props
const isScrollbarAlwaysOn = computed(() => {
// fix https://github.com/element-plus/element-plus/issues/19127
return isIOS ? true : scrollbarAlwaysOn
})
const List = unref(isSized) ? FixedSizeList : DynamicSizeList
@ -269,7 +273,7 @@ export default defineComponent({
ref={listRef}
{...unref(listProps)}
className={ns.be('dropdown', 'list')}
scrollbarAlwaysOn={scrollbarAlwaysOn}
scrollbarAlwaysOn={isScrollbarAlwaysOn.value}
data={data}
height={height}
width={width}