mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
fix(components): [select-v2] pressing the up key may cause errors (#9818)
This commit is contained in:
parent
cb387540a6
commit
c2cec13bf7
@ -559,7 +559,7 @@ const useSelect = (props: ExtractPropTypes<typeof SelectProps>, emit) => {
|
||||
}
|
||||
} else if (direction === 'backward') {
|
||||
newIndex = hoveringIndex - 1
|
||||
if (newIndex < 0) {
|
||||
if (newIndex < 0 || newIndex >= options.length) {
|
||||
// navigate to the last one
|
||||
newIndex = options.length - 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user