How to use lv_textarea_add_text when use Arabic

Hello Everybody:
I meet some problem when doing Arabic Input,I have set LV_USE_BIDI==1 and LV_USE_ARABIC_PERSIAN_CHARS==1.
I found that if I use the lv_textarea_add_text interface to add a string, an error will occur, and the actual string does not meet expectations.But if only a single character is added, the result is as expected.
According to the code, I found that because the lv_label_ins_text interface performs BIDI processing on the input string when LV_USE_BIDI==1, resulting in subsequent character deformation errors.
Excuse me, why is BIDI processing required when LV_USE_BIDI==1 in the lv_label_ins_text interface?
Why is BIDI not processed during Refresh?

Please check this link:
How to add Arabic letters to keyboard - How-to - LVGL Forum

Thank you for your repaly!
I have check the link,but it didn’t solve my problem.

My main problem is that an error occurs when adding multiple Arabic characters.

Example:

lv_textarea_add_text(obj,“جثف”);
“جثف” have multiple Arabic characters.

Expected bahavior:

Actualy behavior

I found that this bidi algorithm affected the results.
If I turn off the bidi algorithm here, the result is correct

Here is the code:

static const char * const default_kb_map_ar[] =
{
“del”, “جثف”, “ص”, “ث”, “ق”, “ف”, “غ”, “ع”, “ه”,“خ”, “ح”,“ج”, “\n”,
“ش”, “س”, “ي”, “ب”, “ل”, “ا”, “ت”, “ن”, “م”, “ك”, “ط”, “\n”,
“ذ”, “ء”, “ؤ”, “ر”, “ى”, “ة”, “و”, “ز”, “ظ”, “د”, “ز”, “ظ”, “د”,"\n",
“1”, “2”, “3”, “4”, “5”, “q”, “w”, “e”, “r”, “!”, “:”, “?”, “(”,"\n",
};

static const lv_btnmatrix_ctrl_t default_kb_ctrl_ar_map[] = {
5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};

static void keyboard_event_cb(lv_event_t *e){
lv_obj_t * obj = lv_event_get_target(e);

lv_keyboard_t * keyboard = (lv_keyboard_t *)obj;
uint16_t btn_id = lv_btnmatrix_get_selected_btn(obj);
if(btn_id == LV_BTNMATRIX_BTN_NONE) return;

const char * txt = lv_btnmatrix_get_btn_text(obj, lv_btnmatrix_get_selected_btn(obj));
if(txt == NULL) return;

if(txt==“del”){lv_textarea_del_char(keyboard->ta);}
else{
lv_textarea_add_text(keyboard->ta, txt);
}
}

LV_FONT_DECLARE(testfont);
void lv_arabic_input_test(void){
static lv_style_t style;
lv_style_init(&style);
lv_style_set_text_font(&style,&testfont);

lv_obj_t *textarea = lv_textarea_create(lv_scr_act());

lv_obj_t *keyboard = lv_keyboard_create(lv_scr_act());
lv_obj_add_style(keyboard, &style, 0);
lv_keyboard_set_mode(keyboard, LV_KEYBOARD_MODE_TEXT_LOWER);
lv_keyboard_set_map(keyboard, LV_KEYBOARD_MODE_TEXT_LOWER, (const char **)default_kb_map_ar, default_kb_ctrl_ar_map);
lv_obj_remove_event_cb(keyboard, lv_keyboard_def_event_cb);
lv_obj_add_event_cb(keyboard, keyboard_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
lv_keyboard_set_textarea(keyboard, textarea);
lv_obj_add_style(textarea, &style, 0);
}