Skip to content

Commit

Permalink
fix: do not focus the field on helper element click (#197)
Browse files Browse the repository at this point in the history
cherry pick of vaadin/web-components#2232 for v14

add missing test

Fixes vaadin/flow-components#955
  • Loading branch information
alvarezguille committed Jul 21, 2021
1 parent d279a66 commit f0a010c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/vaadin-radio-group.html
Expand Up @@ -51,7 +51,6 @@
</div>

<div part="helper-text"
on-click="focus"
id="[[_helperTextId]]"
aria-live="assertive"
aria-hidden$="[[_getHelperTextAriaHidden(helperText, _helperTextId, _hasSlottedHelper)]]">
Expand Down
11 changes: 11 additions & 0 deletions test/vaadin-radio-group.html
Expand Up @@ -492,6 +492,17 @@

expect(radioButtonGroupWithSlottedHelper.hasAttribute('has-helper')).to.be.false;
});

it('should not get focus after helper click', () => {
const group = fixture('default-with-slotted-helper');
const spy = sinon.spy(group, 'focus');
const helper = group.querySelector('[slot="helper"]');

helper.click();

expect(spy.called).to.be.false;
});

});

describe('RTL mode', () => {
Expand Down

0 comments on commit f0a010c

Please sign in to comment.