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

Inconsistent focus behaviour of nested helper components #955

Comments

@edler-san
Copy link

Tested with V14.4.0.alpha1 and the bookstore example:
In ProductForm.java I added a TextField as helper component to another TextField (and another TextField to that).
(For clarity: TextField A, has TextField B as a helper. TextField B has TextField C as a helper.)

When clicking either B or C the field A gets focused and all input lands there. However, when I tab through the fields I can enter text there.
nested-helper

@jcgueriaud1
Copy link
Contributor

I've got the same issue, if you click on the helper slot then the component is clicked.

        availability = new Select<>();
        availability.setLabel("Availability");
        availability.setWidth("100%");
        availability.setItems(Availability.values());
        availability.setHelperComponent(new Button("click here"));
        content.add(availability);

@tomivirkki tomivirkki transferred this issue from vaadin/flow-components Sep 10, 2020
@rolfsmeds
Copy link
Contributor

The scenario depicted is not considered an intended use case for the helper feature. The helper feature, as the name implies, is meant for providing instructions or other simple (primarily non-interactive) elements such as password strength indicators -- it is not a generic layout mechanism for grouping multiple fields or other interactive elements together.

Still, it might be useful to keep focus on the helper in some intended use cases also, so we will look into adding that in a later version.

@jouni
Copy link
Member

jouni commented Jan 7, 2021

What’s the “enhancement” we are looking for here? The use case I can think of is an “additional help” link or icon+tooltip.

The current behavior is a bit strange. I don’t think clicking the helper should do anything special, as it now moves the focus to the field. I might classify this more like a bug than an enhancement.

@rolfsmeds
Copy link
Contributor

That's a good point -- should clicking the helper focus the input field? I don't see why it should (in contrast to the label, which I think makes sense).

@rolfsmeds
Copy link
Contributor

Ok, recategorizing this as a bug, in that the current focus behavior makes any interactive content in the helper weird (although not necessarily unusable), and I don't see why that behavior would be desired even if we don't specifically intend the hepler slot to be used for interactive elements.

@vlukashov vlukashov transferred this issue from vaadin/vaadin-core May 7, 2021
@vlukashov vlukashov added bug Something isn't working Impact: Low Severity: Minor labels May 7, 2021
@vlukashov vlukashov added the BFP label Jun 22, 2021
@hdamr hdamr self-assigned this Jul 5, 2021
alvarezguille added a commit to vaadin/vaadin-checkbox that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-custom-field that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-radio-button that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-select that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-text-field that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-checkbox that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-radio-button that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-select that referenced this issue Jul 21, 2021
alvarezguille added a commit to vaadin/vaadin-text-field that referenced this issue Jul 21, 2021
* 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
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 14.6.7. For prerelease versions, it will be included in its final version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment