Skip to content
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

Merged
merged 8 commits into from
Mar 3, 2020

Conversation

Harry-Ph
Copy link
Contributor

@Harry-Ph Harry-Ph commented Feb 28, 2020

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 and update value of radio-group.

Fixes #125

…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
@claassistantio
Copy link

claassistantio commented Feb 28, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@web-padawan web-padawan left a 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.

test/vaadin-radio-group.html Outdated Show resolved Hide resolved
test/vaadin-radio-group.html Outdated Show resolved Hide resolved
@web-padawan web-padawan changed the base branch from master to 1.3 March 2, 2020 07:59
Copy link
Member

@web-padawan web-padawan left a 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.

See the following GIF:
change

To reproduce it, please update the demo:

<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).

Copy link
Member

@web-padawan web-padawan left a 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.

src/vaadin-radio-group.html Outdated Show resolved Hide resolved
src/vaadin-radio-group.html Outdated Show resolved Hide resolved
src/vaadin-radio-group.html Outdated Show resolved Hide resolved
src/vaadin-radio-group.html Outdated Show resolved Hide resolved
test/vaadin-radio-group.html Outdated Show resolved Hide resolved
test/vaadin-radio-group.html Outdated Show resolved Hide resolved
test/vaadin-radio-group.html Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change event on radio-group should include updated value
3 participants