mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Fixed #4383 - OrderList and PickList: Getting error when empty field
This commit is contained in:
parent
936f95783e
commit
001e22a262
2 changed files with 15 additions and 10 deletions
|
@ -141,14 +141,16 @@ export default {
|
|||
onListFocus(event) {
|
||||
const selectedFirstItem = DomHandler.findSingle(this.list, '[data-p-highlight="true"]');
|
||||
|
||||
const findIndex = ObjectUtils.findIndexInList(selectedFirstItem, this.list.children);
|
||||
if (selectedFirstItem) {
|
||||
const findIndex = ObjectUtils.findIndexInList(selectedFirstItem, this.list.children);
|
||||
|
||||
this.focused = true;
|
||||
this.focused = true;
|
||||
|
||||
const index = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : selectedFirstItem ? findIndex : -1;
|
||||
const index = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : selectedFirstItem ? findIndex : -1;
|
||||
|
||||
this.changeFocusedOptionIndex(index);
|
||||
this.$emit('focus', event);
|
||||
this.changeFocusedOptionIndex(index);
|
||||
this.$emit('focus', event);
|
||||
}
|
||||
},
|
||||
onListBlur(event) {
|
||||
this.focused = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue