Skip to content

fix: do not lose focus on click in Safari - #6780

Merged
vursen merged 3 commits into
mainfrom
checkbox/keep-focus-in-safari
Nov 14, 2023
Merged

vursen merged 3 commits into
mainfrom
checkbox/keep-focus-in-safari

Conversation

@vursen

@vursen vursen commented Nov 13, 2023 •

Copy link
Copy Markdown
Contributor

Description

The PR fixes the issue where checkbox and radio-button lost focus on click in Safari. The issue is fixed by adding a [tabindex=0] attribute to the input elements of the mentioned components.

Fixes #6756

Type of change

  • Bugfix

@vursen vursen changed the title fix: keep focus on input click when already focused fix: keep focus when clicking on already focused input Nov 13, 2023
@sonarqubecloud

Copy link
Copy Markdown

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 marked this pull request as ready for review November 14, 2023 09:37

// Clicking the checkbox or radio-button in Safari
// does not make it focused, so we do it manually.
if (!isElementFocused(input)) {

@vursen vursen Nov 14, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Adding [tabindex=0] eliminated the need for this workaround. All tests now pass without it.

@vursen vursen changed the title fix: keep focus when clicking on already focused input fix: do not lose focus on click in Safari Nov 14, 2023
@vursen
vursen requested a review from web-padawan November 14, 2023 09:51

@web-padawan web-padawan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that the grid-pro focusout issue is fixed 👍

@vursen
vursen merged commit a4aa2a0 into main Nov 14, 2023
@vursen
vursen deleted the checkbox/keep-focus-in-safari branch November 14, 2023 10:06
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @vursen and @vursen, when i performed cherry-pick to this commit to 24.2, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick a4aa2a0
error: could not apply a4aa2a0... fix: do not lose focus on click in Safari (#6780)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @vursen and @vursen, when i performed cherry-pick to this commit to 24.1, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick a4aa2a0
error: could not apply a4aa2a0... fix: do not lose focus on click in Safari (#6780)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.3.0.alpha5 and is also targeting the upcoming stable 24.3.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.

Grid Pro checkboxes can't be clicked on Safari

3 participants