Skip to content

Dropdown.vue: Don't access items at negative indices #8

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlbinoDrought
Copy link

I was having issues when doing the following on a 'selectable' dropdown:

  • Populate a dropdown with items
  • Select an item
  • Change the items in the dropdown
  • Click the dropdown to select it again

It would call scrollIntoView(-1), because the this.selected item no longer existed in the current array of items.

I've added a clause to skip the scrolling if this occurs.

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

Successfully merging this pull request may close these issues.

1 participant