This repository was archived by the owner on May 12, 2021. It is now read-only.
Add publishing keyboard shortcuts#1286
Merged
christianbundy merged 3 commits intomasterfrom May 7, 2020
Merged
Conversation
When I hit cancel, I usually want to keep editing. This small change puts the focus back to the textArea when I hit cancel, so that I can just keep typing right away.
This can be used to e.g. set event handlers or such for the faux-modals we use for confirmation dialogs and such.
Addresses #1285 by adding a key handler to the preview sheet. It also put the focus on the cancel button. The result is that after entering preview with `<Ctrl/Cmd> + <Return>` ... * `<Return>` OR `<Escape>` will cancel the publish and go back to editing * `<Ctrl/Cmd> + <Return>` once more will publish the message.
7e84d5e to
aa5fd97
Compare
black-puppydog
commented
May 6, 2020
Comment on lines
+10
to
+14
| let fullAttributes = { className: 'Sheet', classList } | ||
| if (attributes !== undefined) { | ||
| fullAttributes = { ...attributes, ...fullAttributes } | ||
| } | ||
| const container = h('div', fullAttributes, [ |
Contributor
Author
There was a problem hiding this comment.
This feels like it could be cleaner. I'm passing the classList and the attributes separately just to have them be recombined...
Contributor
Author
There was a problem hiding this comment.
Also, could I maybe attache the event handlers (passed as attributes) to something else that makes more sense?
Contributor
|
Concern: I know that Microsoft Word uses Ctrl+Enter as a page break, but since GitHub does Ctrl+Enter and I haven't seen them criticized for it (???) then I think this is good to go. |
Contributor
Author
|
I wouldn't target feature parity with MS Word, or even shared UX. :P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow fast publish and cancel actions when previewing posts.
Addresses #1285 by adding a key handler to the preview sheet.
It also put the focus on the cancel button. The result is that after
entering preview with
<Ctrl/Cmd> + <Return>...<Return>OR<Escape>will cancel the publish and go back to editing<Ctrl/Cmd> + <Return>once more will publish the message.