List automatically scroll to end when delete top_layer object

List automatically scroll to end when delete top_layer object

What MCU/Processor/Board and compiler are you using?

Linux PC simulator using SDL

What LVGL version are you using?


What do you want to achieve?

List should not scroll automatically when top_layer object deleted

What have you tried so far?

Code to reproduce.

The below code will execute when cancel button pressed

lv_obj_add_event_cb(cancel_btn, top_layer_close_event_cb, LV_EVENT_CLICKED, text_popup_scr);

static void top_layer_close_event_cb(lv_event_t *e)
    lv_event_code_t code = lv_event_get_code(e);
    lv_obj_t *top_layer_scr = lv_event_get_user_data(e);

    if (LV_EVENT_CLICKED == code)
        lv_obj_clear_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE);
        lv_obj_set_style_bg_opa(lv_layer_top(), LV_OPA_TRANSP, 0);
        kb = NULL;


After pressing Cancel Button

Could you please help me to resolve this issue

Hello, have you tried putting the message box on the top layer of the screen? lv_layer_top?

I had a somewhat similar issue some time ago: Lv_roller strange behavior when clearing/adding CLICKABLE flag - #10 by kisvegabor

@Tinus. Yes message box created with lv_layer_top() as parent

Issue is not solved. I tried steps described in @Tinus issue but no luck