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

fix [5015]: Accidentally deleting draft post when you mention an account #5110

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

half144
Copy link

@half144 half144 commented Sep 3, 2024

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

React.useEffect(() => {
if (editor) {
const handleKeyDown = (event: KeyboardEvent) => {
if ((event.metaKey || event.ctrlKey) && event.code === 'ArrowLeft') {

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.

Copy link
Author

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link

@LukeberryPi LukeberryPi left a 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

Copy link
Author

@half144 half144 left a 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.

@half144 half144 requested a review from LukeberryPi September 3, 2024 18:43
Copy link

@Vincentroland Vincentroland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explict

@half144
Copy link
Author

half144 commented Sep 3, 2024

Explict

you can see the error in #5105 that pr take care of this

Co-authored-by: LukeberryPi <lukeberrypi@gmail.com>
Copy link

@Vincentroland Vincentroland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expilct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants