reagent

Ernesto Garcia 2023-06-09T14:07:46.859379Z

Let's say that you implement an input element's onChange for updating a Reagent atom that triggers a change for displaying the count of characters entered somewhere on your UI. The undo behavior of the input element is altered, in a way that it undoes one character at a time, instead of the default behavior of undoing chunks of characters that were entered together. This is probably due to the delayed nature of Reagent UI updates. Has anybody seen this? Can this be avoided?

👀 1
Ernesto Garcia 2023-06-12T07:24:11.588729Z

Sorry guys, I'm not seeing the same behavior today. I'm not sure when the problem manifests.

Ernesto Garcia 2023-06-12T10:12:22.150059Z

It may only happen when the input is controlled.

juhoteperi 2023-06-09T14:09:06.529589Z

You should be able to go around Reagents workaround by creating a input element directly with React call: (react/createElement "input" #js {...} ...) (but then you need to handle other problems yourself.)

Ernesto Garcia 2023-06-09T14:15:18.266409Z

The issue is not because of the ReagentInput wrapper. It will also happen with a standard React input.

Ernesto Garcia 2023-06-09T14:16:24.199209Z

It happens also when the input is not controlled.

❓ 1
Ernesto Garcia 2023-06-09T14:17:26.959129Z

It seems to be the delayed UI update that makes the browser delimit the action to undo.