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

Not sure about active state of imageContainer #56

Open
henrych4 opened this issue Nov 13, 2018 · 0 comments · May be fixed by #57
Open

Not sure about active state of imageContainer #56

henrych4 opened this issue Nov 13, 2018 · 0 comments · May be fixed by #57

Comments

@henrych4
Copy link

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;
@henrych4 henrych4 linked a pull request Nov 13, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant