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

write a plugin for DOM Input Events #2274

Closed
ianstormtaylor opened this issue Oct 17, 2018 · 1 comment
Closed

write a plugin for DOM Input Events #2274

ianstormtaylor opened this issue Oct 17, 2018 · 1 comment

Comments

@ianstormtaylor
Copy link
Owner

ianstormtaylor commented Oct 17, 2018

Do you want to request a feature or report a bug?

Feature.

What's the expected behavior?

With the introduction of "commands", we now have the ability to funnel DOM-level events into the onCommand middleware to decouple DOM events from editor changes. This means we can package up DOM-specific hooks into plugins that can take the actual commands they want to perform as inputs.

For example...

SlateDOMInputEvents({
  formatIndent: 'indentBlocks',
  formatOutdent: 'outdentBlocks',
  formatBold: 'addBoldMark',
  formatItalic: 'addItalicMark',
  ...
})

(Here taking Input Events Level 2 event.inputType values and trigger commands by name when they are received.)

This way editor-level hotkeys like cmd+b could actually be converted into schema-aware commands without having to hardcode the commands in core.

@ianstormtaylor ianstormtaylor changed the title add slate-dom-extended plugin for Input Events write a plugin for DOM Input Events Oct 17, 2018
@ianstormtaylor ianstormtaylor mentioned this issue Nov 6, 2019
@ianstormtaylor
Copy link
Owner Author

Fixed by #3093.

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

Successfully merging a pull request may close this issue.

1 participant