Skip to content

Commit 65740c8

Browse files
authored
fix (text): only use the custom onPaste (for pasting block) when text is the default block and the current text is empty (#3375)
1 parent 7a6d8a2 commit 65740c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/block/text/edit.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ import {
2222
ConditionalDisplay,
2323
Transform,
2424
} from '~stackable/block-components'
25-
import { version as VERSION, i18n } from 'stackable'
25+
import {
26+
version as VERSION,
27+
i18n,
28+
settings,
29+
} from 'stackable'
2630
import classnames from 'classnames'
2731
import {
2832
InspectorTabs,
@@ -144,7 +148,8 @@ const Edit = props => {
144148
onMerge={ mergeBlocks }
145149
onRemove={ onRemove }
146150
onReplace={ onReplace }
147-
onPaste={ onPaste }
151+
// Only use the custom onPaste (for pasting block) when text is the default block and the current text is empty
152+
onPaste={ settings.stackable_enable_text_default_block && props.attributes.text === '' ? onPaste : undefined }
148153
/>
149154
</BlockDiv>
150155
{ props.isHovered && <MarginBottom /> }

0 commit comments

Comments
 (0)