1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-01 19:22:35 +02:00

fix hovering toolbar format hotkeys (#3667)

This commit is contained in:
whyour
2020-05-11 14:01:35 +08:00
committed by GitHub
parent a1ce4477c3
commit 08f7ef588c

View File

@@ -18,6 +18,7 @@ const HoveringMenuExample = () => {
renderLeaf={props => <Leaf {...props} />} renderLeaf={props => <Leaf {...props} />}
placeholder="Enter some text..." placeholder="Enter some text..."
onDOMBeforeInput={event => { onDOMBeforeInput={event => {
event.preventDefault()
switch (event.inputType) { switch (event.inputType) {
case 'formatBold': case 'formatBold':
return toggleFormat(editor, 'bold') return toggleFormat(editor, 'bold')