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

use-controlled - fix controlled input behavior #157

Merged
merged 1 commit into from
Jul 16, 2021
Merged

use-controlled - fix controlled input behavior #157

merged 1 commit into from
Jul 16, 2021

Conversation

Kukkimonsuta
Copy link
Contributor

Fixes #154

This has turned out to be bit more complex than originally anticipated because Select has own state as well that needs to be handled, however I believe I have succeeded.

The behavior should be backwards compatible.

I'm not certain what the expectations of onValueUpdate?(value: T): void; are since it isn't used anywhere and I fail to see possible use cases, however I tried to keep the behavior same.

The hook now returns third value "mode" that indicates whether it's controlled or uncontrolled currently.

@rtivital
Copy link
Member

Thanks for PR, everything works perfect!

@rtivital rtivital changed the base branch from master to next-minor July 16, 2021 06:34
@rtivital rtivital changed the base branch from next-minor to master July 16, 2021 06:35
@rtivital rtivital merged commit 19c65d9 into mantinedev:master Jul 16, 2021
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.

Controlled inputs shouldn't set their value
2 participants