Fork me on GitHub
#reagent
<
2023-12-22
>
j4m3s01:12:19

Hey there! I have a question about handling inputs. I use international qwerty with compose key and in HTML input it works but with inputs with ratom storage it seems that it doesn't (probably because it's sending every keystroke to the ratom) my example input :

[:input {:type "text"
                :value @recipe-title
                :on-change #(reset! recipe-title (-> % .-target .-value))}]
with recipe-title being a reagent atom. Any idea on how to do this ? I'm hoping I can avoid doing something too mutable here. Otherwise a workaround I'm thinking is generating input with a custom id and extracting the value there. Thanks by advance 🙏:skin-tone-2:

p-himik12:12:42

I can't reproduce it on Reagent 1.2.0 with React 17.0.2. E.g. I press the compose key, then ", then u and successfully get a ü in an input field that's backed by a reaction.

p-himik12:12:45

I can reproduce it on the home page of Reagent (https://reagent-project.github.io/) but it might be using an older version of Reagent and/or React.

p-himik12:12:10

On this picture, it should be just ü.

p-himik13:12:36

Hmm, it seems to be using React 18. Might be the culprit, no clue.

1
j4m3s00:12:28

I'll try to set up a repro somewhere. At least now I know of a setup to reproduce this. Will try to get back to you in a few days ~ Thank you!

👍 1