Skip to content

Change Start Position of Dropdown #951

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 2 commits into
base: master
Choose a base branch
from

Conversation

mikefdesign
Copy link

This adds the ability to scroll the dropdown content to the selected item when opened using the prop scrollToSelected 743

@mikefdesign
Copy link
Author

@shentao - any feedback on this?

Copy link
Owner

@shentao shentao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this behave with multiple selections?

@@ -33,6 +42,20 @@ export default {
this.pointerAdjust()
},
isOpen () {
if (!this.hideSelected && this.scrollToSelected && this.value) {
let value = JSON.parse(JSON.stringify(this.value))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s try to avoid removing the reference from the value. Would be best to approach this problem without having to mutate anything. Also, doing parse/stringify will throw errors with recursive objects that might sometimes be a case.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A multiselect array will scroll to the first item in the values array. If this is inadequate, do you have any suggestions?
Do you have a suggestion for the isOpen block other than not using parse/stringify?

@jaywilburn
Copy link

Is this making it into the next release? I could use this on multiple projects.

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.

4 participants