Skip to content

Commit

Permalink
Merge pull request #3946 from primefaces/issue-3870
Browse files Browse the repository at this point in the history
OrderList: change focus index method fixed for empty items cases
  • Loading branch information
tugcekucukoglu authored May 11, 2023
2 parents 34cca51 + d885ec6 commit 56087ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/orderlist/OrderList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ export default {
let order = index >= items.length ? items.length - 1 : index < 0 ? 0 : index;
this.focusedOptionIndex = items[order].getAttribute('id');
this.scrollInView(items[order].getAttribute('id'));
this.focusedOptionIndex = items[order] ? items[order].getAttribute('id') : -1;
this.scrollInView(this.focusedOptionIndex);
},
scrollInView(id) {
const element = DomHandler.findSingle(this.list, `li[id="${id}"]`);
Expand Down

0 comments on commit 56087ac

Please sign in to comment.