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

chore(react): <Editable /> flushsync onChange function #1441

Merged

Conversation

junghyeonsu
Copy link
Contributor

@junghyeonsu junghyeonsu commented Sep 20, 2023

There is currently an issue in @zag-js/editable 0.21.0 where passing an object with a state value of useState and using the <Editable /> component in controlled form does not control the value as desired.

You can see a demo below.
(Currently, the logic is set up so that the value is fixed at 10000, but you can see that any value above 10000 will be input).

To fix this, modify the code for zag and ark.

In zag, we'll add logic to synchronize if the externally input value is different from the internal value.

In ark, we apply flushSync to onChange.

If there is a better form, please let me know.

cc. @malangcat

@vercel
Copy link

vercel bot commented Sep 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ark-docs ✅ Ready (Inspect) Visit Preview Sep 20, 2023 8:00pm

@cschroeter cschroeter merged commit f039b5e into chakra-ui:main Sep 20, 2023
7 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants