From d885ec6b4531e6968c0fc462b3a4d22a8f0edf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bahad=C4=B1r=20Sofuo=C4=9Flu?= Date: Wed, 10 May 2023 13:37:19 +0300 Subject: [PATCH] change focus index issue fixed for empty items cases --- components/lib/orderlist/OrderList.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/orderlist/OrderList.vue b/components/lib/orderlist/OrderList.vue index 61c5f2c44..3d47ea5cf 100755 --- a/components/lib/orderlist/OrderList.vue +++ b/components/lib/orderlist/OrderList.vue @@ -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}"]`);