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

selectable-search-input to expose its current value to be updated manually from the outside #2573

Open
YahiaElTai opened this issue Aug 2, 2023 · 0 comments

Comments

@YahiaElTai
Copy link
Contributor

Describe the bug
selectable-search-input is a controlled input and doesn't allow manual updates to the current value from the outside (uncontrolled way) for example with Formik's setFieldValue. I think most other ui-kit components allow this behavior but not this component.

To Reproduce
I'm using the component in this way:

  • The user changes the value of the component and hit Enter. the value of the input is then put in the URL to maintain the state across refresh and also page changes
  • Once the page load, then within a useEffect, I try to get the value of the input from the URL (previous step) and use setFieldValue from Formik to update the current value of the input, however I don't have access to the value of the input from the outside, I only have access to the default value which is not useful after the rendering is done.
  • This means after refresh, the URL has the correct value but the input is empty which is misleading for the user.

Expected behavior
This component should allow modifying its current value from the outside like other ui-kit components (uncontrolled component)

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

1 participant