-
Notifications
You must be signed in to change notification settings - Fork 10
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 by changing from 2 ways binding to 1 way binding of checked prope… #137
Conversation
…rty on radio-button, because after trigger _onChange on radio-button, the checked prop is updated and then it will trigger checked-changed event listener on radio-group and update its value on radio-group, and change event on radio-group is dispatched that includes updated value
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 update the tests to use async callbacks.
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 PR does not fix the issue with change event on keyboard selection.
To reproduce it, please update the demo:
vaadin-radio-button/demo/radio-button-basic-demos.html
Lines 81 to 89 in e2c6697
<div id="output">Selected value:</div> | |
<script> | |
window.addDemoReadyListener('#value-change-event', function(document) { | |
const radioButtonGroup = document.querySelector('vaadin-radio-group'); | |
const output = document.querySelector('#output'); | |
radioButtonGroup.addEventListener('value-changed', function(event) { | |
output.textContent = radioButtonGroup.value; | |
}); | |
}); |
to use change
event instead of value-changed
. Then select and press arrow keys (up / down).
9468819
to
180298f
Compare
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.
Some comments related to code style, please fix.
7fcae56
to
316765a
Compare
Fixes by changing from 2 ways binding to 1 way binding of checked property on radio-button, because after trigger _onChange on radio-button, the checked prop is updated and then it will trigger checked-changed event listener on radio-group and update its value on radio-group, and change event on radio-group is dispatched that includes updated value.
In the keyboard selection case, changed the order of
checks the checkbox, causing the change event
andupdate value of radio-group
.Fixes #125