Skip to content

Commit

Permalink
fix(text): only use the custom onPaste (for pasting block) when text …
Browse files Browse the repository at this point in the history
…is the default block and the current text is empty
  • Loading branch information
Arukuen committed Nov 28, 2024
1 parent 81f1002 commit 3a0ac64
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/block/text/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ import {
ConditionalDisplay,
Transform,
} from '~stackable/block-components'
import { version as VERSION, i18n } from 'stackable'
import {
version as VERSION,
i18n,
settings,
} from 'stackable'
import classnames from 'classnames'
import {
InspectorTabs,
Expand Down Expand Up @@ -144,7 +148,8 @@ const Edit = props => {
onMerge={ mergeBlocks }
onRemove={ onRemove }
onReplace={ onReplace }
onPaste={ onPaste }
// Only use the custom onPaste (for pasting block) when text is the default block and the current text is empty
onPaste={ settings.stackable_enable_text_default_block && props.attributes.text === '' ? onPaste : undefined }
/>
</BlockDiv>
{ props.isHovered && <MarginBottom /> }
Expand Down

0 comments on commit 3a0ac64

Please sign in to comment.