-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix [5015]: Accidentally deleting draft post when you mention an account #5110
base: main
Are you sure you want to change the base?
Conversation
React.useEffect(() => { | ||
if (editor) { | ||
const handleKeyDown = (event: KeyboardEvent) => { | ||
if ((event.metaKey || event.ctrlKey) && event.code === 'ArrowLeft') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in windows, the hotkey for navigating to the previous page on chrome is alt + ←
, not ctrl + ←
.
we should test if the bug is reproducible in windows and adjust the code accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right! I don't have a windows machine nearby to test this, but the issue will very likely occur in that environment as well. i'll make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to check if the bug happens on windows and adjust the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Alt key to cover Windows machines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explict
you can see the error in #5105 that pr take care of this |
Co-authored-by: LukeberryPi <lukeberrypi@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expilct
Fixed: Accidentally deleting draft post when you mention an account #5105
This PR fixes the cursor movement functionality to the beginning of the line when the Cmd + ArrowLeft (or Ctrl + ArrowLeft) key combination is pressed. Previously, the behavior was not working as expected due to issues with setting the selection in the editor.
Screenshots:
364027282-bd9931a7-b71b-43c9-9403-3fe297a5676c.mov