Skip to content

toolbar does not disappear #371

@kel093

Description

@kel093

Hello. I am apologise if i duplicate the issue, but i don't found it in list of issue's.
I am using the AlloyEditor and today saw strange behaviour. I selected the text after this the toolbar is appears, then i clicked on the any place on the screen and the toolbar does not disappear.
bug

I investigated how plugin works and understood the problem, the problem is that editor.status == "ready" and listener "contentDom" will not be called. That's means that listeners "mousedown" and "keydown" are not be added to document.

I fixed this problem, please see my changes in function componentDidMount().

        if (editor && editor.status == "ready") {
            document.addEventListener('mousedown', this._mousedownListener);
            document.addEventListener('keydown', this._keyDownListener);
        } else {
            editor.once('contentDom', (function () {
                document.addEventListener('mousedown', this._mousedownListener);
                document.addEventListener('keydown', this._keyDownListener);
            }).bind(this));
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions