Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home/End keys in active editor #1686

Closed
5 tasks done
zewa666 opened this issue Sep 20, 2024 · 3 comments · Fixed by #1690
Closed
5 tasks done

Home/End keys in active editor #1686

zewa666 opened this issue Sep 20, 2024 · 3 comments · Fixed by #1690

Comments

@zewa666
Copy link
Contributor

zewa666 commented Sep 20, 2024

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
Copy link
Owner

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.

this._bindEventService.bind(this._input, 'keydown', ((event: KeyboardEvent) => {
this._isValueTouched = true;
this._lastInputKeyEvent = event;
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
event.stopImmediatePropagation();
}
}) as EventListener);

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

@zewa666
Copy link
Contributor Author

zewa666 commented Sep 21, 2024

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

@zewa666 zewa666 changed the title Pos1/End keys in active editor Home/End keys in active editor Sep 21, 2024
@ghiscoding
Copy link
Owner

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

zewa666 added a commit to zewa666/slickgrid-universal that referenced this issue Sep 23, 2024
ghiscoding added a commit that referenced this issue Sep 23, 2024
fix: home and end keys stop propagation on input based editors, closes #1686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants