Fixed #4383 - OrderList and PickList: Getting error when empty field
parent
936f95783e
commit
001e22a262
|
@ -141,14 +141,16 @@ export default {
|
||||||
onListFocus(event) {
|
onListFocus(event) {
|
||||||
const selectedFirstItem = DomHandler.findSingle(this.list, '[data-p-highlight="true"]');
|
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.changeFocusedOptionIndex(index);
|
||||||
this.$emit('focus', event);
|
this.$emit('focus', event);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onListBlur(event) {
|
onListBlur(event) {
|
||||||
this.focused = false;
|
this.focused = false;
|
||||||
|
|
|
@ -265,14 +265,17 @@ export default {
|
||||||
},
|
},
|
||||||
onListFocus(event, listType) {
|
onListFocus(event, listType) {
|
||||||
const selectedFirstItem = DomHandler.findSingle(this.$refs[listType].$el, '[data-p-highlight="true"]');
|
const selectedFirstItem = DomHandler.findSingle(this.$refs[listType].$el, '[data-p-highlight="true"]');
|
||||||
const findIndex = ObjectUtils.findIndexInList(selectedFirstItem, this.$refs[listType].$el.children);
|
|
||||||
|
|
||||||
this.focused[listType] = true;
|
if (selectedFirstItem) {
|
||||||
|
const findIndex = ObjectUtils.findIndexInList(selectedFirstItem, this.$refs[listType].$el.children);
|
||||||
|
|
||||||
const index = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : selectedFirstItem ? findIndex : -1;
|
this.focused[listType] = true;
|
||||||
|
|
||||||
this.changeFocusedOptionIndex(index, listType);
|
const index = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : selectedFirstItem ? findIndex : -1;
|
||||||
this.$emit('focus', event);
|
|
||||||
|
this.changeFocusedOptionIndex(index, listType);
|
||||||
|
this.$emit('focus', event);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onListBlur(event, listType) {
|
onListBlur(event, listType) {
|
||||||
this.focused[listType] = false;
|
this.focused[listType] = false;
|
||||||
|
|
Loading…
Reference in New Issue