Skip to content
Discussion options

You must be logged in to vote

Code

Hey! I was working on the same thing and solved it by updating the Text component type. (as mentioned in docs)

import grapesjs from '../../../lib/grapesjs'

export default (editor: grapesjs.Editor) => {
    const Component = editor.DomComponents.getType('text')
    return {
        extend: 'text',
        model: {
            ...Component.model.prototype,
            defaults: {
                ...Component.model.prototype.defaults,
                isPlaceholder: false,
            },
            init() {
                if (this.get('isPlaceholder')) {
                    this._placeholder = this.getInnerHTML()
                    this._updateListener = this.onUpdate.bind(this)
    …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ronaldohoch
Comment options

Answer selected by ronaldohoch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants