Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reagent component with input box loses focus on change when tracking atom #52

Closed
mathfarmer opened this issue Oct 12, 2015 · 8 comments
Closed

Comments

@mathfarmer
Copy link

Having a lot of fun with devcards and figwheel, but ran into the following issue: if I add a reagent component with an input box that updates on change to a card and also try tracking the atom those changes flow to, the input box loses focus on every change, i.e. on every keystroke. Gist to reproduce is here.

Note that there is an easy enough workaround for this: duplicate the card, but don't pass the state atom to that one. The one without the atom accepts changes to the input box without losing focus just fine, and you still get the live state display and history tracking in the other card, which otherwise works just fine.

@bhauman
Copy link
Owner

bhauman commented Oct 12, 2015

Try adding :watch-atom false to the devcards options

@mathfarmer
Copy link
Author

Adding :watch-atom false to the options had no effect.

@bhauman
Copy link
Owner

bhauman commented Oct 13, 2015

Hmmmm must be a bug ... I think that option is being ignored.

@bhauman
Copy link
Owner

bhauman commented Oct 17, 2015

I found the problem in Reagent:
reagent-project/reagent#195

@bhauman
Copy link
Owner

bhauman commented Oct 17, 2015

and here is a new version of your gist fixed
https://gist.github.com/bhauman/24407865e5714c2e023a

@mathfarmer
Copy link
Author

Cool! Thanks for tracking that down. I will track the upstream issue. Closing this one down.

Thanks again! Your tools really do make UI work pleasant.

@bhauman bhauman reopened this Oct 18, 2015
@bhauman
Copy link
Owner

bhauman commented Oct 18, 2015

I was wrong about that I am fixing this in Devcards right now.

@bhauman
Copy link
Owner

bhauman commented Oct 19, 2015

This is fixed in the recent release of Devcards.

@bhauman bhauman closed this as completed Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants