fix bug with editing textarea
This commit is contained in:
parent
778a03ae88
commit
b8a6971363
1 changed files with 3 additions and 3 deletions
|
|
@ -13,15 +13,15 @@ let insert_quote el _event =
|
|||
match find_by_id_opt "comment" with
|
||||
| None -> log "element `comment` not found, not logged in?@\n"
|
||||
| Some textarea ->
|
||||
let inner_html = El.Prop.jstr (Jstr.of_string "innerHTML") in
|
||||
let content = Jstr.to_string @@ El.prop inner_html textarea in
|
||||
let value = El.Prop.value in
|
||||
let content = Jstr.to_string @@ El.prop value textarea in
|
||||
let new_content =
|
||||
if String.ends_with ~suffix:"\n" content || String.length content = 0 then
|
||||
(* don't skip a line *)
|
||||
Format.sprintf "%s[>%s] " content emojid
|
||||
else Format.sprintf "%s@\n[>%s] " content emojid
|
||||
in
|
||||
El.set_prop inner_html (Jstr.of_string new_content) textarea;
|
||||
El.set_prop value (Jstr.of_string new_content) textarea;
|
||||
El.set_has_focus true textarea
|
||||
|
||||
(* make image description field visible when a file is selected*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue