mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [select-v2] pressing the up key may cause errors (#9818)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user