Skip to content

Commit

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

Fixes vaadin/flow-components#955
  • Loading branch information
alvarezguille committed Jul 21, 2021
1 parent db608ec commit 94a4af5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/vaadin-checkbox-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
</div>

<div part="helper-text"
on-click="focus"
aria-live="assertive"
aria-hidden$="[[_getHelperTextAriaHidden(helperText, _hasSlottedHelper)]]">
<slot name="helper">[[helperText]]</slot>
Expand Down
10 changes: 10 additions & 0 deletions test/vaadin-checkbox-group_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,16 @@

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;
});
});
});

Expand Down

0 comments on commit 94a4af5

Please sign in to comment.