Fork me on GitHub
#reagent
<
2017-12-19
>
Oliver George02:12:25

Is there a standard workaround for the "input cursor jumping" problem?

Oliver George02:12:53

I'd like to use the blueprintjs EditableText control but each character typed makes the cursor jump to the end.

Oliver George02:12:24

I think reagent has hardcoded a workaround for standard inputs.

justinlee22:12:55

The reagent docs recommend that all application state be stored in a top-level atom. If we do that, doesn’t that mean that every component will end up rerendering on any update to any portion of the state?

gadfly36122:12:39

@lee.justin.m if you deref the full ratom everywhere, basically yes. However that is not recommended.if using vanilla reagent, using cursors is recommended and if using re-frame, then subscriptions are recommended. These lends a way to scope what changes your component cares about

justinlee22:12:49

@gadfly361 Ah thanks. cursors are the concept I was missing.

worlds-endless23:12:06

Does on-load not work this way under React?

justinlee23:12:59

@worlds-endlessI’ve never tried to attach an onload to an <a> before, but I thought it only worked for things that have resources, like the window itself, <img> and XHR

justinlee23:12:28

looking at the react docs, it only seems to be supported for <img>