From df7d9a0fe0d8bff53b72418d768476b746060226 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 9 Oct 2022 14:40:11 +1000 Subject: [PATCH] fix(NumberEdit): do not call setValue() in constructor, use update() instead (#76) This avoids writing a value when it is not necessary. All that is needed is to update the internal value and set the field string. Co-authored-by: Raphael Coeffic --- radio/src/thirdparty/libopenui/src/numberedit.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/numberedit.cpp b/radio/src/thirdparty/libopenui/src/numberedit.cpp index 0f4507c11..e202e29ec 100644 --- a/radio/src/thirdparty/libopenui/src/numberedit.cpp +++ b/radio/src/thirdparty/libopenui/src/numberedit.cpp @@ -54,10 +54,7 @@ NumberEdit::NumberEdit(Window* parent, const rect_t& rect, int vmin, int vmax, lv_textarea_set_one_line(lvobj, true); lv_obj_add_event_cb(lvobj, numberedit_cb, LV_EVENT_KEY, this); - if (_getValue) { - auto value = _getValue(); - this->setValue(value); - } + update(); } void NumberEdit::onEvent(event_t event)