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

Feature Request: onClear callback #931

Open
lucksp opened this issue Mar 19, 2024 · 0 comments
Open

Feature Request: onClear callback #931

lucksp opened this issue Mar 19, 2024 · 0 comments

Comments

@lucksp
Copy link

lucksp commented Mar 19, 2024

Is your feature request related to a problem? Please describe.

I currently use the results of the Autocomplete in a form. When the user presses the X to clear, I need to capture this event so I can update my form state.

A clear and concise description of what the problem is.
As a user, I should be able to clear the form and have it update accurately.
As a developer, I should be able to capture the clearing of the form as an event to update internal state so the form is not submitted with stale data.

Describe the solution you'd like

When the user presses the X there should be an event that captures this, as a callback.

A clear and concise description of what you want to happen.

Create a callback onClear prop that is a simple () => void type so I can handle what I need.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

 onChangeText: val => {
              if ((!val && field.value.place) || field.value.details) {
                handleSelection();
              }
            },

Additional context

Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant