-
Notifications
You must be signed in to change notification settings - Fork 83
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: do not focus the field on helper element click #2232
Conversation
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.
I have checked the other implementations e.g. Material components:
https://material.io/components/text-fields
https://material-ui.com/components/text-fields/#form-props
In those cases, clicking the helper text does not focus the input.
So we probably can do the same and remove click
listeners.
…in various components.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Co-authored-by: Hadi Amiri <[email protected]>
cherry pick of vaadin/web-components#2232 for v14 cherry pick of vaadin/web-components#2256 for v14 Fixes vaadin/flow-components#955
cherry pick of vaadin/web-components#2232 for v14 Fixes vaadin/flow-components#955
cherry pick of vaadin/web-components#2232 for v14 add missing test Fixes vaadin/flow-components#955
cherry pick of vaadin/web-components#2232 for v14 Fixes vaadin/flow-components#955
cherry pick of vaadin/web-components#2232 for v14 Fixes vaadin/flow-components#955
cherry pick of vaadin/web-components#2232 for v14 cherry pick of vaadin/web-components#2256 for v14 Fixes vaadin/flow-components#955
cherry pick of vaadin/web-components#2232 for v14 add missing test Fixes vaadin/flow-components#955
cherry pick of vaadin/web-components#2232 for v14 Fixes vaadin/flow-components#955
* fix: do not focus the field on helper element click cherry pick of vaadin/web-components#2232 for v14 Fixes vaadin/flow-components#955 * chore: move helper tests with own fixture into own suite also pick vaadin/web-components#2251 for v14 also pick vaadin/web-components#2256 for v14
@web-padawan I'm wondering.. did we miss the combo box? The issue is still there https://vaadin.com/docs/latest/example?path=component/combobox/combo-box-custom-entry-1.ts |
Description
Some components that have
helper-text
capability, When theirhelper-text
is set viaslot
and a component likevaadin-text-field
is put inside of them, the moment the user clicks on the input in the helper slot, the focus jumps to the component that sits higher than our input that is in theslot
. There is also another problem withvaadin-select
, When we have a button as helper text, click on that button causes thevaadin-select
input to be opened automatically which is not our intended behaviour.This PR fixes this issue by removing
on-click
from various components that have such handler onhelper-text
element.It also fixes the issue with
vaadin-select
when a button is used inside helper, click on the button causes the select element to be opened, it fixes it by preventing default behaviour when helper text is clicked.Fixes vaadin/flow-components#955
Type of change
Checklist