I cant get the text area focused by tapping on it after defocusing it with functions

Description

I have an input field (text area) where the user can input a numeric data. When it is focused the built-in numeric keyboard appears. I am trying to use the keyboard’s checkmark (✓) to defocus a text area when the user is done with inputting the data. I save the input data from the UI in the defocus event hander.
If I defocus the text area by tapping somewhere on an empty area everything works fine, but when I want to defocus it programmatically with functions, I am able to do the defocusing part, but I am not able to refocus the text area again by tapping on it again for several seconds. It is not getting focused and the keyboard is not appearing when I touch it. If I tap somewhere empty beforehand, it works fine again even if it was defocused with the keyboard’s checkmark (✓) . Is there some other functions I need to call to be able to focus it again after defocusing it with functions?

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

STM32F767 nucleo board

What LVGL version are you using?

9.2

What do you want to achieve?

I can make it work if I simulate a touch at an empty space with the keyboard’s checkmark (✓) but I want a cleaner solution.

What have you tried so far?

I tried this method:
lv_obj_clear_state(obj, LV_STATE_FOCUSED);
and I also tried triggering the defocus event:
lv_obj_send_event(obj, LV_EVENT_DEFOCUSED, NULL);
Both of them are doing the defocusing part, but I cant refocus the text area by touching it again right after I defocused it for several seconds.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

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

Can you try calling lv_indev_reset(); in your callback?

That solved it, thank you very much.
Full solution for anyone having the same issue later:
lv_obj_send_event(input_field, LV_EVENT_DEFOCUSED, NULL);
lv_indev_reset(indev,input_field);

I’m glad it worked, I’ve had the same issue before. Though it does seem a bit odd to me that you need to reset the input device yourself. As of my understanding lv_keyboard_def_event_cb() handles closing the keyboard on LV_EVENT_CLOSE, but why wouldn’t it reset the indev then as well? Does it get stuck in the textbox when lv_keyboard_def_event_cb handles the close event?

EDIT: It looks like that’s the case considering the widgets demo has the following line:
lv_indev_reset(NULL, ta); /*To forget the last clicked object to make it focusable again*/

Would it not make sense to add something like this to the default handler? @kisvegabor