Skip to content

fix: do not dispatch cell-focus on mouse up outside of cell - #3587

Merged
sissbruecker merged 5 commits into
masterfrom
fix/cell_focus_on_mouse_up
Mar 23, 2022
Merged

sissbruecker merged 5 commits into
masterfrom
fix/cell_focus_on_mouse_up

Conversation

@sissbruecker

Copy link
Copy Markdown
Member

Description

Fixes a workaround in Chrome for the cell-focus event, where a mouse up event outside of the grid could trigger a cell focus event from a cell. The fix involves checking if the mouse up event occured on the same cell as the mouse down event.

Fixes vaadin/flow-components#2863

Type of change

  • Bugfix

// mousedown. Workaround: listen for mousedown and focus manually.
cellContent.addEventListener('mousedown', () => {
if (window.chrome) {
if (isChrome) {

@sissbruecker sissbruecker Mar 21, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The previous check did not work properly in tests with headless Chrome.

Comment thread packages/grid/src/vaadin-grid.js Resolved
@sissbruecker
sissbruecker requested a review from vursen March 23, 2022 07:58
@sissbruecker
sissbruecker requested a review from vursen March 23, 2022 08:19
@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

@sissbruecker
sissbruecker merged commit 380da50 into master Mar 23, 2022
@sissbruecker
sissbruecker deleted the fix/cell_focus_on_mouse_up branch March 23, 2022 09:06
vaadin-bot pushed a commit that referenced this pull request Mar 23, 2022
* fix: do not dispatch cell-focus on mouse up outside of cell

* import chrome check from test helpers

* address review comments

* add test for clicking on cell content child

* refactor to skip whole suite
vaadin-bot pushed a commit that referenced this pull request Mar 23, 2022
* fix: do not dispatch cell-focus on mouse up outside of cell

* import chrome check from test helpers

* address review comments

* add test for clicking on cell content child

* refactor to skip whole suite
sissbruecker added a commit that referenced this pull request Mar 23, 2022
…3593)

* fix: do not dispatch cell-focus on mouse up outside of cell

* import chrome check from test helpers

* address review comments

* add test for clicking on cell content child

* refactor to skip whole suite

Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
sissbruecker added a commit that referenced this pull request Mar 23, 2022
…3594)

* fix: do not dispatch cell-focus on mouse up outside of cell

* import chrome check from test helpers

* address review comments

* add test for clicking on cell content child

* refactor to skip whole suite

Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

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

CellFocusEvent is triggered when dragging a grid row.

3 participants