glide-data-grid icon indicating copy to clipboard operation
glide-data-grid copied to clipboard

Keep focus in overlay editor

Open BrianHung opened this issue 1 year ago • 2 comments

Tries to fix #910

  • if an editor is a native html input or textarea, we use readOnly instead of disabled; this allows the element to be focus-able but not editable. Benefit of this is that selection still works if a person wants to copy the cell content.
  • for editors without a focusable element (and also editors in general), instead of using an invisible textarea with autofocus=true, we make the overlay editor focusable itself and autofocused on mount; shouldn't conflict with editors with autofocused elements since children renders after parent

We should add some tests to check that click within cell and then pressing escape works for each internal cell editor.

BrianHung avatar Mar 09 '24 00:03 BrianHung

I think this looks fine. But also a bit risky since it touches a very important part. I will try to do another iteration and check it out locally + read a bit about potential downsides.

lukasmasuch avatar Jun 17 '25 20:06 lukasmasuch

Not a blocker for me; it is important that we find a way to always maintain focus if user is interacting with the grid, and not have it be lost unexpectedly to body. There can be other alternatives to this PR as well.

BrianHung avatar Jun 17 '25 22:06 BrianHung