-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Feat] Improve QSelect #1186
[Feat] Improve QSelect #1186
Conversation
* Add props scroll-height to select component * Function prevent is placed in a separate module * Fix in Autocomplete component (addEventListener on 'keydown')
src/components/select/QSelect.vue
Outdated
case 40: // down | ||
this.__moveCursor(1, e) | ||
break | ||
case 13: // enter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add SPACE as selection toggle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add, thanks )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Adding SPACE handler will make it impossible to enter a space in the filter. I revert this change. Let's wait for @rstoenescu
src/components/select/QSelect.vue
Outdated
@@ -170,7 +178,11 @@ export default { | |||
autofocusFilter: Boolean, | |||
radio: Boolean, | |||
placeholder: String, | |||
separator: Boolean | |||
separator: Boolean, | |||
scrollHeight: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a more appropriate name like listMaxHeight and use an empty default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks! listMaxHeight will be more appropriate.
I`m not sure about empty default. E.g. IE do not recognized scroll on viewport without setting "heigh" or "max-heigt" property...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for Razvan's opinion on this also. (@rstoenescu)
* add SPACE as set current selection thanks (pdanpdan)[https://github.com/pdanpdan]
* QAutocomplete.vue -> QAutocomplete.js
* remove props autofocus-filter * autofocus filter only on desktop platform * first suggestion in list only on desktop * fix emit blur and focus
* fix needless emit focus when click on current field
* Implement disabled individual options in QSelect (quasarframework#1051)
…r class contains * QSelect: some refactoring
* some adpat fixes and refactors
These improvements would be really nice! Let's hope they get merged soon! wink wink nudge nudge |
Can we also have an option to filter if the user starts typing and the QSelect is focused? |
As far as i know it will be available in v1 |
It is! Scott |
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Some explanation of this proposed feature
When focused on select field (by press key "Tab" on previous field eg) then press key "Enter" will be show popover with list options. If there is a filter then it will be focused (assumed that user uses keyboard and dont want mouse click). Keyboard navigation when filter focused also available.
When popover with list options showing - if there is selected item(s) (field value) then viewport will scroll first encountered option in the middle viewport.
And there is available navigation:
Press key "Up" or "Down"
Pres key "Enter" on option:
Press key "Esc":
Press key "Tab":
Press keys "Shift+Tab":
When user inputs a filter then first option suggest to be "enter" (only on desktop platform)
Additional info:
close #903