Duplicate chars when using the textarea_max_length function

I am creating a program for work where I take user input (IP addresses) and I do it through a text area field. I need to limit the char count to 3 chars for each section of the IP address ( i.e. xxx.yyy.zzz.uuu). However, when I use the lv_textarea_set_max_length() function, it always registers every char input as a double.

For example, if I type “a” and have it printed to the console, it’ll show up as “aa”
This also happened when using the lv_textarea_set_accepted_chars() function as well.

Please help!!!

Which event are you using to find out when input is added to the text area? Is it LV_EVENT_INSERT?

Yes, it is. Then in the if (event == LV_EVENT_INSERT) block of code, I use the str = lv_event_get_data(); to get the received input and then immediately output it to the screen.

Yes, it is. Then in the if (event == LV_EVENT_INSERT) block of code, I use the str = lv_event_get_data(); to get the received input and then immediately output it to the screen.