yabwe / medium-editor

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
https://yabwe.github.io/medium-editor/
Other
16.08k stars 1.85k forks source link

Toolbar not showing on selecting text. #1581

Open mdsafeeuddin opened 3 years ago

mdsafeeuddin commented 3 years ago

I'm using medium-editor in angular 11. Its a blog application, where i'm using medium-editor for blog content ("medium-editor": "^5.23.3",). On trying to edit the same content, after saving and re fetching from the database, toolbar does not show.

when i create a new blog the toolbar shows on selecting the content written, but when i try to update the content by selecting, toolbar does not show.

I have MediumEditorComponent, which is being used in the parent component as

on fetching the data back from server, i'm sending the data to medium editor component through an input: <medium-editor [dataForInnerHtml]="data"></medium-editor>

and in MediumEditorComponent, i'm setting this data in editor as: this.editor.setContent(this.dataForInnerHtml)

and my toolbar options goes like this:

        allowMultiParagraphSelection: true,
        buttons: this.BUTTONS,
        diffLeft: 0,
        diffTop: -10,
        firstButtonClass: 'medium-editor-button-first',
        lastButtonClass: 'medium-editor-button-last',
        // relativeContainer: null,
        standardizeSelectionStart: true,
        static: false,
        /* options which only apply when static is true */
        align: 'center',
        sticky: false,
        updateOnEmptySelection: false
      }

Screenshot from 2021-07-05 15-32-14 Screenshot from 2021-07-05 15-35-30