-
I've noticed the use of the Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
v1 docs are WIP but in the meantime see this https://codesandbox.io/s/slate-plugins-playground-v1-2mh1c?file=/index.tsx:1728-1872. You can overwrite default components/options by key ( |
Beta Was this translation helpful? Give feedback.
-
I understand, but how can I ensure that the default elements (on hitting enter/new line, for example) are NOT |
Beta Was this translation helpful? Give feedback.
-
What do you mean by paragraph? Slate node
|
Beta Was this translation helpful? Give feedback.
-
It seems that this answer was related to the old version of plate. Whether there is a any possibility to change ELEMENT_DEFAULT to another type now? Also that it will affect the behavior of all other plate plugins, for example List plugin should insert custom ELEMENT_DEFAULT while last list child removed. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Is there any way to set the default element for the editor in one place itself? If not, is there any doc reference to set the default element for any plugin and/or component? |
Beta Was this translation helpful? Give feedback.
What do you mean by paragraph? Slate node
type: 'p'
or React component<p>
, or the plugin key?getSlatePluginsOptions
:[ELEMENT_DEFAULT]: { type: 'anything' }
getSlatePluginsComponents
:[ELEMENT_DEFAULT]: getComponent(StyledElement, { as: 'div' }),
or any other componentELEMENT_DEFAULT
being different thanELEMENT_PARAGRAPH
, that's not supported yet, they're both equal to'p'
. Solution would be to PR or create another paragraph plugin that uses another key.