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

Manually Triggering async button action #75

Open
sarus opened this issue Dec 10, 2015 · 2 comments
Open

Manually Triggering async button action #75

sarus opened this issue Dec 10, 2015 · 2 comments

Comments

@sarus
Copy link

sarus commented Dec 10, 2015

Thanks for the great plugin. It has been very useful. I have a use case where my async button runs a search. The search can be triggered when the user clicks on the async-button (the search button) or when the user presses enter on the input.

What's the best way to trigger the async button's action when the user presses enter on the input? Before I was using async-button both pressing enter on the input and clicking the search button called the same action.

Now that I'm using the async-button this won't work as pressing enter doesn't have a callback and doesn't put the button into a "pending" state.

Is the best practice here to manually set disableWhen to true when the user uses the enter key along with a separate action path that handles setting disableWhen back to false?

Thank you!

@banjolina-jolie
Copy link

I have the same question!

@Dhaulagiri
Copy link
Contributor

I was able to work around this by creating a listener on the enter key and when the key is pressed manually invoking a .click() on the async button

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

3 participants