-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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(VSelect): emit selected listIndex event #7828
feat(VSelect): emit selected listIndex event #7828
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #7828 +/- ##
=========================================
- Coverage 85.8% 85.79% -0.01%
=========================================
Files 334 334
Lines 9095 9096 +1
Branches 2418 2418
=========================================
Hits 7804 7804
- Misses 1203 1204 +1
Partials 88 88
Continue to review full report at Codecov.
|
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.
- rebase to
next
-
menuListIndex
sounds a bit wordy probably change to justlistIndex
instead
28f4223
to
62a4957
Compare
Thanks for your comments ;) Added on |
@MajesticPotatoe any chance to merge this? |
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.
- doc updates need to be added for combobox as well (as this change effects this)
- test should probably be moved to v-select as its where the change roots from.
- should probably standardize event name in docs to kebab case like how
prepend-inner
/prepend-outer
/etc are
notes: - your playground is out of date. should be
@update:listIndex
notupdate:menu-list-index
- PR is still under review as to whether it will make it into 2.0 or not (As we are already really close to release). any other thoughts @vuetifyjs/core-team ?
@MajesticPotatoe I have applied your suggestions, thanks :) |
packages/vuetify/src/components/VSelect/__tests__/VSelect4.spec.ts
Outdated
Show resolved
Hide resolved
@MajesticPotatoe any chance to have it in current 1.X version too? I'm not sure when we will migrate our project to 2.0. I can also use the forked version if its not possible. |
Unfortunately 1.5 is no long receiving features as it is entering LTS and will only receive critical updates and bug fixes. |
@mateuszgachowski I was looking for a decent solution for catching the |
Guys, anytime soon this will get pulled? |
@MajesticPotatoe @johnleider what could be your major concerns that keep you from merging this PR? |
Guys, are we pulling this to main repo? :) Its been a while... |
It would definitely be frustrating to see the issue being labelled with |
* docs(component): menuListIndex event added to docs Add update:menuListIndex event to VSelect documentation in events tab * feat(VSelect): add update:listIndex event to VSelect update:listIndex added to VSelect to indicate when keyboard-selected item is changed * chore(deps): bump lodash.template from 4.4.0 to 4.5.0 (#7808) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.4.0...4.5.0) Signed-off-by: dependabot[bot] <support@github.com> * chore(release): publish v2.0.0-beta.8 * docs(vue-analytics): revert autoTracking parameter * feat(VSelect): code review updates, name unification Unified naming in docs to use kebab-case, moved tests to VSelect dir * feat(VSelect): event name update:listIndex -> update:list-index Changed event name to kebab case as in vue guide
Hi guys,
This is my first contribution to Vuetify. Thank you all for your hard work doing this amazing software!
Description
Adds
update:menuListIndex
event forv-select
/v-autocomplete
components to inform on any menu index change (using keyboard). This is helpful for example to indicate if an item is selected or not (index-1
).Motivation and Context
v-autocomplete
andv-select
does not provide a clear way to indicate if any item in the menu was selected. This event is triggered when keyboard arrows are used to change the selection.It could help reacting on empty "enter" keypress.
For my case I was doing a search input with suggestions with pretty default logic:
input
) is triggered.There wasn't any prop or event that could indicate that the selected index is not
-1
. I wasn't able to decide which strategy should be triggered when "enter" was hit. With this change I can for example store the index and check it on@keyup.enter
event.How Has This Been Tested?
I've used playground to test both the
v-autocomplete
andv-select
for event emission.I have created one unit test that checks if event is fired when navigating on the suggestion items.
Markup:
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and breaking changes).