fix(roller): fix bubbling events (#4542)

This commit is contained in:
Stephan Wirth
2023-09-20 10:27:36 +02:00
committed by GitHub
parent dda20cf98e
commit f77cacd1b7
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -334,7 +334,7 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e)
if(res != LV_RESULT_OK) return;
const lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
lv_obj_t * obj = lv_event_get_current_target(e);
lv_roller_t * roller = (lv_roller_t *)obj;
if(code == LV_EVENT_GET_SELF_SIZE) {
@@ -161,6 +161,14 @@ void test_roller_keypad_events(void)
TEST_ASSERT_EQUAL(expected_index, actual_index);
}
void test_roller_with_overlay_and_bubble_events_enabled(void)
{
lv_obj_t * overlay = lv_obj_create(roller);
lv_obj_add_flag(overlay, LV_OBJ_FLAG_EVENT_BUBBLE);
lv_obj_send_event(overlay, LV_EVENT_PRESSED, NULL);
}
//void test_roller_infinite_mode_first_option_gets_selected_after_last_option(void)
//{
// char actual_str[OPTION_BUFFER_SZ] = {0x00};