-
-
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
fix(VSelect): propagate name attribute to hidden input #10327
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously the "VSelect should update inner input element" test only asserted the initial state of the input value attribute. Now it also asserts that changing the selected item will update the input value.
Fixes missing name attribute on inner input element by passing it manually from component attributes. Includes unit tests on VSelect and VCombobox to verify bugfix. fix vuetifyjs#10152
jacekkarczmarczyk
added
C: VSelect
VSelect
T: bug
Functionality that does not work as intended/expected
labels
Jan 25, 2020
johnleider
requested changes
Jan 27, 2020
@@ -319,4 +319,17 @@ describe('VCombobox.ts', () => { | |||
|
|||
expect(wrapper.vm.$attrs.autocomplete).toBe('on') | |||
}) | |||
|
|||
it('should pass the name attribute to the inner input element', async () => { |
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.
The genHiddenInput method is never overwritten and this is already tested in v-select
https://github.com/vuetifyjs/vuetify/pull/10327/files#diff-5b5fcac8ce361d1dfbffa8cdea0bca32R453.
johnleider
changed the title
Resolves Issue #10152
fix(VSelect): propagate name attribute to hidden input
Jan 27, 2020
johnleider
added
T: regression
Something that used to work but we broke
and removed
T: bug
Functionality that does not work as intended/expected
labels
Jan 27, 2020
Remove test already comvered in VSelect test
Thanks, @johnleider. Edits have been implemented. |
johnleider
approved these changes
Jan 27, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Resolves Issue #10152, a regression introduced by merging #9598.
This fixes the missing
name
attribute on the inner hidden input element insideVSelect
. Sincename
is now removed from the inner text input, it needed to be manually added to the hidden input from theVSelect
attribute list.Motivation and Context
For users that rely on the traditional form input name/value structure to validate and/or submit forms, it's essential that all Vuetify field components maintain this underlying behavior.
How Has This Been Tested?
This PR Includes unit tests on VSelect and VCombobox to confirm the bug and verify the fix. It also completes the related unit test for the VSelect hidden input value by properly testing that changing the selected item updates the input value.
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and backwards compatible changes andnext
for non-backwards compatible changes).