diff --git a/radio/src/gui/colorlcd/libui/table.cpp b/radio/src/gui/colorlcd/libui/table.cpp index e4884ee983b..83b296a8673 100644 --- a/radio/src/gui/colorlcd/libui/table.cpp +++ b/radio/src/gui/colorlcd/libui/table.cpp @@ -320,3 +320,13 @@ void TableField::setAutoEdit() lv_group_set_editing(g, true); } } + +void TableField::deleteLater(bool detach, bool trash) +{ + if (!deleted()) + if (autoedit) { + lv_group_t* g = (lv_group_t*)lv_obj_get_group(lvobj); + lv_group_set_focus_cb(g, nullptr); + lv_group_set_editing(g, false); + } +} diff --git a/radio/src/gui/colorlcd/libui/table.h b/radio/src/gui/colorlcd/libui/table.h index d088e06182a..1ad0bdc99fe 100644 --- a/radio/src/gui/colorlcd/libui/table.h +++ b/radio/src/gui/colorlcd/libui/table.h @@ -64,5 +64,7 @@ class TableField : public Window void onEvent(event_t event) override; bool onLongPress() override; + void deleteLater(bool detach = true, bool trash = true) override; + static void force_editing(lv_group_t* g) { lv_group_set_editing(g, true); } };