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

AutoComplete: completeOnFocus with keyboard navigation #2824

Closed
rico opened this issue Aug 3, 2022 · 5 comments
Closed

AutoComplete: completeOnFocus with keyboard navigation #2824

rico opened this issue Aug 3, 2022 · 5 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@rico
Copy link

rico commented Aug 3, 2022

Describe the feature you would like to see added

It would be nice if completeOnFocus works with keyboard navigation as well, not only when the user clicks the input.

Is your feature request related to a problem?

Suggestions do not open, when the user navigates to the Autocomplete input using the keyboard.

Describe the solution you'd like

Open suggestions if Autofocus input receives focus.

Describe alternatives you have considered

Add focus event listener to the input using the ref and open the suggestions.

Additional context

No response

@rico rico added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Aug 3, 2022
@tugcekucukoglu tugcekucukoglu added Status: Pending Review Issue or pull request is being reviewed by Core Team Component: Accessibility Issue or pull request is related to WCAG or ARIA and removed Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add labels Aug 3, 2022
@tugcekucukoglu
Copy link
Member

Could you please try to use v3.16.0? If problem is still persist, please reopen this same issue with a codesandboz example.

@tugcekucukoglu tugcekucukoglu removed Status: Pending Review Issue or pull request is being reviewed by Core Team Component: Accessibility Issue or pull request is related to WCAG or ARIA labels Aug 15, 2022
@rico
Copy link
Author

rico commented Aug 15, 2022

Unfortunately with v3.16.0 the completeOnFocus does not work at all - not even on click. I have the following declaration:

<AutoComplete v-model="_clientService.service"
                      @complete="onComplete"
                      @item-select="onServiceSelected"
                      placeholder="Leistung suchen ..."
                      :suggestions="_services"
                      :forceSelection="true"
                      class="w-full"
                      input-class="w-full"
                      :minLength="2"
                      :autoHighlight="true"
                      :completeOnFocus="true"
                      :field="servicesSearchLabel" />

And with v3.16.0 this combination pre-selects (sets as v-model) the first item from the suggestion. If I remove :autoHighlight="true", no pre-selection happens, but the suggestions do not open on focus. Searching & select, however, works as before.

@tugcekucukoglu tugcekucukoglu added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Aug 15, 2022
@rico
Copy link
Author

rico commented Aug 16, 2022

@tugcekucukoglu let me know if I can help with something (testing, etc.). Do you still need that codesandbox example?

@rico
Copy link
Author

rico commented Aug 17, 2022

@tugcekucukoglu created a test repo: https://github.com/smartcode-ch/primevue-autocomplete-issue ... was easier because codesandbox does not support <script setup>.

Just switch primevue version to 3.15.0 to see the difference.

Hope that helps, and thanks for looking into this!

@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Aug 17, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.16.1 milestone Aug 17, 2022
@tugcekucukoglu tugcekucukoglu self-assigned this Aug 17, 2022
@tugcekucukoglu
Copy link
Member

Yes, codesandbox does not support <script setup>, but it doesn't matter we could try it in local environment.

Thanks for your time.

mertsincan added a commit that referenced this issue Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants