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

Unable to select a menu item when you have to scroll down (big issue) #453

Closed
tbl0605 opened this issue Jun 4, 2021 · 4 comments · Fixed by #462
Closed

Unable to select a menu item when you have to scroll down (big issue) #453

tbl0605 opened this issue Jun 4, 2021 · 4 comments · Fixed by #462
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Milestone

Comments

@tbl0605
Copy link
Contributor

tbl0605 commented Jun 4, 2021

Hi,
when the dropdown menu contains a big number of items, it happens that you have to scroll down (with the mouse) to show the items that are "below the screen".
When you try to select an item that was not firstly visible on screen, the focus will jump back on the input (by automatically scrolling up) but the selected item value will not not inserted in the input field!
That's a really big issue.

You can see it directly on the demo at https://kazanexpress.github.io/vue-simple-suggest/
Simply reduce the height of your navigator, scroll down with the mouse and try to select an item that was not initially visible on screen.
chrome-capture20210604

You can also try my demo from issue #441 at https://codesandbox.io/s/demo-french-cities-vue-simple-suggest-qru7e

In my screenshots, you can see that I selected the item "54370 PARROY", that the page scrolled up but that the value was not inserted in the input field:

chrome-capture20210604B

@tbl0605 tbl0605 changed the title Unable to select a menu item when you have to scroll down Unable to select a menu item when you have to scroll down (big issue) Jun 4, 2021
@kaskar2008 kaskar2008 self-assigned this Jun 4, 2021
@kaskar2008 kaskar2008 added bug Something isn't working help wanted Extra attention is needed labels Jun 4, 2021
@kaskar2008 kaskar2008 added this to To do in Fixes via automation Jun 4, 2021
@kaskar2008 kaskar2008 added this to the 1.11 milestone Jun 4, 2021
@kaskar2008
Copy link
Member

Hello @tbl0605
I can confirm the issue. But I think it won't be a quick fix due to the core concept of selecting elements. We should discuss how we will solve this problem, though.

@tbl0605
Copy link
Contributor Author

tbl0605 commented Jun 4, 2021

Yes with pleasure. Because at first look, I haven't found the problem in your code :S

@tbl0605
Copy link
Contributor Author

tbl0605 commented Jun 4, 2021

Meanwhile I found an easy workaround to fix the problem.
In vue-simple-suggest.vue I replaced

          setTimeout(() => {
            this.inputElement.focus()
          }, 0)

by

          setTimeout(() => {
            this.inputElement.focus()
          }, 200)

Maybe the focus() code should be moved inside suggestionClick(suggestion, e), but that's just a guess for now.

@tbl0605
Copy link
Contributor Author

tbl0605 commented Jun 23, 2021

Hi @kaskar2008,
could you have a look at fix for this issue and for issue #463 please?

Thank you!

Fixes automation moved this from To do to Done Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Fixes
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants