fix(NcCheckboxRadioSwitch): use reactive state for group checkbox toggle#8324
Draft
pringelmann wants to merge 1 commit intomainfrom
Draft
fix(NcCheckboxRadioSwitch): use reactive state for group checkbox toggle#8324pringelmann wants to merge 1 commit intomainfrom
pringelmann wants to merge 1 commit intomainfrom
Conversation
The array/group checkbox path in onToggle read input.checked from the DOM via getInputsSet(). On keyboard spacebar, the browser toggles input.checked before firing the change event, so the DOM-read logic inverted the intended action and emitted the stale modelValue. Replace DOM queries with reactive-state reads (this.isChecked and this.internalModelValue) which correctly reflect the pre-toggle state regardless of the event source. Fixes #8321 Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8324 +/- ##
==========================================
+ Coverage 52.40% 53.01% +0.60%
==========================================
Files 104 104
Lines 3393 3388 -5
Branches 989 988 -1
==========================================
+ Hits 1778 1796 +18
+ Misses 1359 1344 -15
+ Partials 256 248 -8 β View full report in Codecov by Sentry. π New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The array/group checkbox path in onToggle read input.checked from the DOM via getInputsSet(). On keyboard spacebar, the browser toggles input.checked before firing the change event, so the DOM-read logic inverted the intended action and emitted the stale modelValue.
Replace DOM queries with reactive-state reads (this.isChecked and this.internalModelValue) which correctly reflect the pre-toggle state regardless of the event source.
Fixes #8321
βοΈ Resolves
πΌοΈ Screenshots
π§ Tasks
π Checklist
stable8for maintained Vue 2 version or not applicable