diff --git a/examples/react/components/editor/config.tsx b/examples/react/components/editor/config.tsx index 4551e19fa..3884c9546 100644 --- a/examples/react/components/editor/config.tsx +++ b/examples/react/components/editor/config.tsx @@ -1,4 +1,4 @@ -import { $, removeUnit } from '@aomao/engine'; +import { $, isMobile, removeUnit } from '@aomao/engine'; import type { PluginEntry, CardEntry, @@ -35,7 +35,7 @@ import Unorderedlist from '@aomao/plugin-unorderedlist'; import Indent from '@aomao/plugin-indent'; // import type { IndentOptions } from '@aomao/plugin-indent'; import Heading from '@aomao/plugin-heading'; -// import type { HeadingOptions } from '@aomao/plugin-heading'; +import type { HeadingOptions } from '@aomao/plugin-heading'; import Strikethrough from '@aomao/plugin-strikethrough'; // import type { StrikethroughOptions } from '@aomao/plugin-strikethrough'; import Sub from '@aomao/plugin-sub'; @@ -389,7 +389,12 @@ export const toolbarOptions: ToolbarOptions = { }, }; +const headingOptions: HeadingOptions = { + showAnchor: isMobile ? false : true, +}; + export const pluginConfig: Record = { + [Heading.pluginName]: headingOptions, [ToolbarPlugin.pluginName]: toolbarOptions, [Table.pluginName]: tableOptions, [MarkRange.pluginName]: markRangeOptions, diff --git a/examples/react/components/editor/index.less b/examples/react/components/editor/index.less index 2ae58ff65..44ecc78b7 100644 --- a/examples/react/components/editor/index.less +++ b/examples/react/components/editor/index.less @@ -107,7 +107,7 @@ @media @mobile { padding: 0; height: auto; - overflow: hidden; + overflow: inherit; } } diff --git a/packages/engine/src/block/index.ts b/packages/engine/src/block/index.ts index a9ccbfb5a..e782c2e8f 100644 --- a/packages/engine/src/block/index.ts +++ b/packages/engine/src/block/index.ts @@ -45,7 +45,7 @@ class Block implements BlockModelInterface { .getHandleListener('backspace', 'keydown') ?.on((event) => backspace.trigger(event)); - event.on('keydown:space', (event) => this.triggerMarkdown(event)); + event.on('keyup:space', (event) => this.triggerMarkdown(event)); } }