-
-
Notifications
You must be signed in to change notification settings - Fork 757
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: equation input undo regession #3923
base: main
Are you sure you want to change the base?
Conversation
2. feat: add equation and inline-equation elements in editor and slashmenu
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for adding the UI! |
apps/www/src/registry/default/components/editor/use-create-editor.ts
Outdated
Show resolved
Hide resolved
@@ -79,9 +78,6 @@ export const useEquationInput = ({ | |||
} else if (isHotkey('escape')(e)) { | |||
e.preventDefault(); | |||
onDismiss(); | |||
} else if (isHotkey('meta+z')(e)) { | |||
e.preventDefault(); | |||
editor.undo(); | |||
} else if (isHotkey('meta+y')(e) || isHotkey('meta+shift+z')(e)) { |
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.
seems not work in macos cmd + shift + z
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.
hmm, what's the expected behavior for cmd shift z in macos?
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.
If you really need to do this, you can use Hotkeys.isUndo
and Hotkeys.isRedo
from packages/core/src/lib/utils/hotkeys.ts
.
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.
I was careless yesterday and did not see the redo logic below 😥, i think simply deleting it makes the most sense?
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.
The effect looks great. @wststone
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.
but I found an another history issue.
history issue is really tricky.
focus.mp4
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.
Referring to Notion, I think what we need to do is to avoid opening the popover during an undo action.
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.
I will take a look
|
… menu to prevent autoclose
Fix regression of #3852, I basically just deleted the handle check of the
meta+z
keydown event and let the native event handles the undo behavior.Also added equation and inline-equation elements to the www editor and slashmenu, so there's more showcasing and also i can test locally.
Checklist
yarn typecheck
yarn lint:fix
yarn test
yarn brl
yarn changeset