Skip to content

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

Open
@YahiaElTai

Description

@YahiaElTai

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions