From 653dafe7ab0f8750f302fddbe4fa7c21104ca9e4 Mon Sep 17 00:00:00 2001 From: Dheeraj Reddy Date: Fri, 27 Dec 2019 00:55:19 +0530 Subject: [PATCH] elm_genlist: Fix looping in case first or last item is disabled. Summary: Issue with item focus in loop-up when last item is disabled, check is added to get previous valid item in this case. Similar change added to loop-down handling. Change-Id: I2c7b413f29d84b2f5b82d207532c183865082f12 Signed-off-by: Dheeraj Reddy --- src/lib/elementary/elm_genlist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index e4a22a2..7d4539c 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -6059,6 +6059,9 @@ _elm_genlist_looping_up_cb(void *data, ELM_GENLIST_DATA_GET(genlist, sd); Elm_Object_Item *eo_it = elm_genlist_last_item_get(genlist); + ELM_GENLIST_ITEM_DATA_GET(eo_it, gen_it); + while (_is_no_select(gen_it) || elm_wdg_item_disabled_get(eo_it)) + eo_it = elm_genlist_item_prev_get(eo_it); // TIZEN_ONLY(20150629): add checking item bring in enable on item looping switch (_elm_config->focus_autoscroll_mode) @@ -6093,6 +6096,9 @@ _elm_genlist_looping_down_cb(void *data, ELM_GENLIST_DATA_GET(genlist, sd); Elm_Object_Item *eo_it = elm_genlist_first_item_get(genlist); + ELM_GENLIST_ITEM_DATA_GET(eo_it, gen_it); + while (_is_no_select(gen_it) || elm_wdg_item_disabled_get(eo_it)) + eo_it = elm_genlist_item_next_get(eo_it); // TIZEN_ONLY(20150629): add checking item bring in enable on item looping switch (_elm_config->focus_autoscroll_mode) -- 2.7.4