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 (#3375)
  • Loading branch information
Arukuen authored Jan 15, 2025
1 parent 7a6d8a2 commit 65740c8
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 65740c8

Please sign in to comment.