Spinbox number input issue

Description

2 words showing with 1 number key press action in widget spinbox

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

Windows

What LVGL version are you using?

V9

What do you want to achieve?

1 words showing with 1 nubmer key press action in widget spinbox

What have you tried so far?

Delete lv_textarea_add_char(obj, c);
in lv_spinbox.c line:395

Code to reproduce

I think it can be reproduced in the document page.

Spinbox (lv_spinbox) — LVGL documentation

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.
1

I think this issue is because spinbox is inherited from textarea widget.

In the initialize stage spinbox will have a baseclass like:.base_class = &lv_textarea_class,
And the spinbox’s defalut event cb will call : res = lv_obj_event_base(MY_CLASS, e); in lv_spinbox.c line:303

Which leads to the textarea’s default event cb to call lv_textarea_add_char() firstly.
Then the pinbox’s defalut event cb will call lv_textarea_add_char() again.

I want to have one word only changing in each press action. But I also need some features in both spinbox and textarea so I can not change the derivation or block the event passing in these two widgets.

I don’t want to change the LVGL folder’s files at all.My idea is to replace the whole default event cb for spinbox but there a lots of internal member.

Is there any idea to fix this?

BR/Kuan