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

Escape doesn't close cell overlay consistently

Open lukasmasuch opened this issue 1 year ago • 2 comments

If you open a cell and press Escape, it closes the cell overlay. But if you click inside the cell (if it is readonly), escape will do nothing:

https://github.com/glideapps/glide-data-grid/assets/2852129/23898488-2505-4f7f-a1c4-5da6c1b145fd

Is there a reason for this? It would probably be more consistent if esc always closes the cell overlay.

lukasmasuch avatar Feb 27 '24 09:02 lukasmasuch

I also ran into this issue where escape does noop like what @LukasMasuch mentioned

huang47 avatar Feb 27 '24 18:02 huang47

This is probably a bug. What happens when the text cell is readonly and you try clicking on it, because the textarea is disabled, focus is transferred from canvas to body. And then onKeyDown doesn't work anymore to escape the editor.

~~We would probably need a focus trap for this (?).~~ We can use the readonly attribute for input and textarea to be able to keep focus but disable editing.

https://github.com/glideapps/glide-data-grid/assets/15721634/812d72e8-682a-4018-a1ab-8651a1aec1ee

BrianHung avatar Mar 08 '24 23:03 BrianHung