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] Add a public method to focus the component #150

Closed
rvanderkooy opened this issue Jul 18, 2020 · 5 comments · Fixed by #166
Closed

[Feature Request] Add a public method to focus the component #150

rvanderkooy opened this issue Jul 18, 2020 · 5 comments · Fixed by #166
Labels
Feature New feature that will be added to the project

Comments

@rvanderkooy
Copy link

Is your feature request related to a problem? Please describe.
I'm trying to find a way to programmatically expand the result dropdown list

Describe the solution you'd like
I would like to see a public method that can be called that will focus the input box and expand the dropdown list

Describe alternatives you've considered
I have tried to set focus using JSInterop to see if that would trigger it, with no luck.

Additional context
I have a bootstrap modal that contains the Typeahead control along with Save and Cancel buttons. I'm trying to have the Typeahead control expand when the modal opens.

@rvanderkooy rvanderkooy added Feature Request Request to add a new feature Triage Issue needs to be triaged labels Jul 18, 2020
@chrissainty chrissainty added this to the v5 milestone Jul 19, 2020
@chrissainty
Copy link
Member

I think the way we could offer this would be a public method on the component called Focus, for example. You can then get a reference to the component using the @ref directive then just invoke Focus.

@chrissainty chrissainty added Feature New feature that will be added to the project and removed Feature Request Request to add a new feature Triage Issue needs to be triaged labels Jul 19, 2020
@chrissainty chrissainty changed the title [Feature Request] [Feature Request] Add a public method to focus the component Jul 19, 2020
@rvanderkooy
Copy link
Author

A public Focus method would be great. I’d be glad to help however I can. Thanks.

@Kylar182
Copy link

Kylar182 commented Aug 2, 2020

@arivera12
Copy link

did you try passing the autofocus attribute on the input?

@kiasyn
Copy link
Contributor

kiasyn commented Sep 16, 2020

I have submitted a pull request that implements this functionality... #166

chrissainty added a commit that referenced this issue Dec 11, 2020
Co-authored-by: Sam O'Connor <sam@sniper.co.nz>
Co-authored-by: Chris Sainty <chrissainty@users.noreply.github.com>
@chrissainty chrissainty removed this from the v5 milestone Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature that will be added to the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants