vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
470 stars 83 forks source link

activeElement in vaadin-grid is nulled when enabling the grid #6234

Open javier-godoy opened 1 year ago

javier-godoy commented 1 year ago

Description

The activeElement in vaadin-grid is nulled when enabling the grid.

(As a workaround delay focusing until the grid is reenabled).

Expected outcome

I would weakly expect either the active element to be preserved.

Minimal reproducible example

https://vaadin.com/docs/latest/example?path=component/grid/grid-basic.ts

Steps to reproduce

image

Environment

Vaadin version(s): 24.1

Browsers

Chrome

tomivirkki commented 1 year ago

Also, see the related Slack thread

yuriy-fix commented 1 year ago

Summary from Slack discussion:


This seems to be native behaviour in Chrome only:

 - focus an element inside the shadow root
 - Add tabindex -1 to the host element
 - Remove the tabindex
 - The previously focused element gets blurred!

This doesn’t happen in Safari and Firefox