elm_genlist: Fix looping in case first or last item is disabled. 38/221038/1
authorDheeraj Reddy <dheeraj.sj@samsung.com>
Thu, 26 Dec 2019 19:25:19 +0000 (00:55 +0530)
committerDheeraj Reddy <dheeraj.sj@samsung.com>
Thu, 26 Dec 2019 19:35:04 +0000 (01:05 +0530)
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 <dheeraj.sj@samsung.com>
src/lib/elementary/elm_genlist.c

index e4a22a2..7d4539c 100644 (file)
@@ -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)