diff --git a/components/rtgui/widgets/textbox.c b/components/rtgui/widgets/textbox.c index 9fd86b7efde864a13ab5393b9c18cf4067f9fa65..2bde9cebbe81f1a87948acbd696d8345f4c0f346 100644 --- a/components/rtgui/widgets/textbox.c +++ b/components/rtgui/widgets/textbox.c @@ -326,6 +326,8 @@ void rtgui_textbox_set_value(struct rtgui_textbox* box, const char* text) if (box->line_length > rt_strlen(text) + 1) { rt_memcpy(box->text, text, rt_strlen(text) + 1); + /* set current position */ + box->position = 0; return; } else