Skip to content

Not sure about active state of imageContainer #56

@henrych4

Description

@henrych4

First, thanks for the great library.

Here is the situation: Toolbar of ImageNode is activated when node is clicked even the editor is set to be read-only. And it is probably related to the following line:
https://github.com/Canner/canner-slate-editor/blob/0330dc6000a3e31ff6aa7a46309c54eddb6c4acf/packages/renderer/renderer/src/components/imageContainer.js#L42

After taking a deeper look into the history, it seems that in the commit 4766849, code was refactored but variable active was wrongly assigned.

Previously, toolbar is active when the condition (!isSelected || readOnly) is false, ie. active toolbar only when ImageNode is selected and is not readOnly. Therefore variable active should be set to the negation of (!isSelected || readOnly), ie.

const active = isSelected && !readOnly;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions