ghiscoding / slickgrid-universal

Slickgrid-Universal is a monorepo which includes all Editors, Filters, Extensions, Services related to SlickGrid usage and is also Framework Agnostic
https://ghiscoding.github.io/slickgrid-universal/
Other
90 stars 29 forks source link

Home/End keys in active editor #1686

Closed zewa666 closed 2 months ago

zewa666 commented 2 months ago

Describe the bug

When a cell editor is focused, the arrow keys left and right are intercepted and cell navigation disabled. This is good as it allows to navigate within the Inputs text. Same works with CTRL + Left/Right to jump to start/end of the editor.

what does not work is hitting the pos1 (jumps to first cell of row) or end key (jumps to last cell of the active row)

I wonder whether this is an expected behavior or a bug. I can provide a PR if this indeed is an unintended behavior

Reproduction

see above

Which Framework are you using?

Angular

Environment Info

| Executable          | Version |
| ------------------- | ------- |
| (framework used)    | VERSION |
| Slickgrid-Universal | VERSION |
| TypeScript          | VERSION |
| Browser(s)          | VERSION |
| System OS           | VERSION |

Validations

ghiscoding commented 2 months ago

Hmm I'm not sure what is Pos1, perhaps it's because I'm currently on the laptop. So far, what I can find is that there's some arrow listener in the input editor for arrow left/right, but anything else with Ctrl is about copy/paste for Ctrl+C, Ctrl+V, Ctrl+S or Ctrl+Z apart from that I'm not sure what would catch the event, you can maybe debug that in developer tool.

https://github.com/ghiscoding/slickgrid-universal/blob/3c6ce204dd9b48091b4c49c5c07b5799b3af34b9/packages/common/src/editors/inputEditor.ts#L115-L121

Also another important thing to note is that cell navigation is really only working when autoCommitEdit is set to False

zewa666 commented 2 months ago

oops sry I'm used to german layouts and Pos1 (Position1) is its take on the home key 😅

the ctrl + left/right works because the same listener is stopping direct propagation.

and yeah that would be exactly the place where I'd try to extend the listener to the other two keys.

my main question is still whether you think this is a bug or working as expected

ghiscoding commented 2 months ago

most probably an unwanted behavior, so I would think the same as you and consider this a bug