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: invoke setFocused only on events triggered by focusElement #6060

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Jun 26, 2023

Description

The PR ensures that setFocused() of DelegateFocusMixin is only invoked when the focus event is triggered by focusElement. Components can have multiple focusable elements, e.g. an input element and a custom button in a suffix slot. Previously, setFocused(false) could be also invoked on a focusout triggered by an element other the focusElement, which led to unexpected validation in certain components.

Fixes vaadin/flow-components#5136

Type of change

  • Bugfix

@vursen vursen marked this pull request as ready for review June 26, 2023 13:28
@vursen vursen requested a review from web-padawan June 26, 2023 14:14
@vursen vursen force-pushed the fix/do-not-call-set-focused-when-not-focused branch from 9b2be55 to d0899e5 Compare June 27, 2023 09:43
@vursen vursen changed the title fix: do not invoke setFocused on focusout when not focused fix: do not invoke setFocused when focusout not triggered by focusElement Jun 27, 2023
@vursen vursen changed the title fix: do not invoke setFocused when focusout not triggered by focusElement fix: do not invoke setFocused on focusout not triggered by focusElement Jun 27, 2023
@vursen vursen changed the title fix: do not invoke setFocused on focusout not triggered by focusElement fix: invoke setFocused only on focus events caused by focusElement Jun 27, 2023
@vursen vursen changed the title fix: invoke setFocused only on focus events caused by focusElement fix: invoke setFocused only on focus events triggered by focusElement Jun 27, 2023
@vursen vursen changed the title fix: invoke setFocused only on focus events triggered by focusElement fix: invoke setFocused only on events triggered by focusElement Jun 27, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen vursen requested a review from web-padawan June 27, 2023 10:36
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.2.0.alpha2 and is also targeting the upcoming stable 24.2.0 version.

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

Successfully merging this pull request may close these issues.

Binder validation is triggered when suffix component opens a non-modal Dialog
3 participants