Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(text): only use the custom onPaste (for pasting block) when text … #3375

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading