This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-25
Channels
- # 100-days-of-code (6)
- # announcements (4)
- # aws (2)
- # beginners (151)
- # boot (1)
- # calva (1)
- # cider (19)
- # clara (47)
- # cljdoc (9)
- # cljs-dev (25)
- # clojars (18)
- # clojure (151)
- # clojure-canada (1)
- # clojure-conj (1)
- # clojure-dev (17)
- # clojure-italy (42)
- # clojure-nl (34)
- # clojure-spec (67)
- # clojure-uk (125)
- # clojurescript (163)
- # core-async (106)
- # cursive (19)
- # data-science (11)
- # datomic (9)
- # duct (2)
- # figwheel (1)
- # figwheel-main (6)
- # fulcro (97)
- # graphql (9)
- # instaparse (4)
- # jobs (6)
- # jobs-discuss (21)
- # leiningen (62)
- # mount (23)
- # off-topic (16)
- # re-frame (15)
- # reagent (16)
- # reitit (5)
- # remote-jobs (1)
- # ring-swagger (9)
- # shadow-cljs (176)
- # tools-deps (102)
- # unrepl (3)
I'm having some issues with using reagent with cljsjs/material-ui. When using material-ui/Input (after adapting) as a controlled input, and using android Firefox (desktop Firefox works fine), the input does not correctly fire events. Lets say I tried to type "example" into the input. When "e" is pressed, the input reads "e" When "x" is pressed, the input reads "eex" When "a" is pressed, the input reads "eexea" When "m" is pressed, the input reads "eexeaeexm" When "p" is pressed, the input reads "eexeaeexmeexeap" I got it down to a pretty simple failing example: (defonce text (reagent/atom "")) (defn input [] [material/Input {:value @text :on-change #(reset! text (-> % .-target .-value))}]) This bug only occurs on Firefox for android, and does not occur on Firefox Focus for android. From some println debugging, it seems events are being fired twice on Firefox. Has anyone run into this before?
@reilysiegel does this relate to the problem https://github.com/reagent-project/reagent/issues/265#issuecomment-397895508
it’s a more general reagent/controlled input/react thing though, nothing about android/firefox specific
so perhaps could be a separate issue, I haven’t heard of the one you have above before, but just wondering if the state is being messed up for the same reasons as there
So maybe something like that, inspired by the text field example you can find at that GitHub link. You’d use MuiAdaptedInput
in place of the base mui/Input
.
Thanks for the link! Ill try it when I get home in a few hours, and let you know if it works!
Yeah, a bit of a long shot since I wouldn’t expect things to work on some environments and not others and also not sure the stuff you showed above is the same sort of case since it seems to be extra firing changes or something. but still probably worth a initial try to see if it does affect it at all.
hey guys, what do you think about https://reactjs.org/docs/hooks-reference.html in reagent?
at this point I'm close to replacing reagent with React and a decent hiccup compiler
Interesting. I wonder if e.g. useReducer
will work with Cljs data structures.