globocom / megadraft

Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility

Home Page:http://megadraft.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After updating megadraft the editor is always not editable unless I reload

HakimJu opened this issue · comments

-- Feature --

Supply setReadOnly to the Block component in order to change and manipulate readOnly state

Description

There is a use case when trying to implement creation/update of block via a Modal. The update modal is being triggered when clicking on the block output
Screenshot 2021-03-19 at 17 50 06

On clicking on the block

Screenshot 2021-03-19 at 17 49 53

When submitting or closing the modal the editor is always not clickable unless I reload the page seems like focus on MediaWrapper is always true although the modal is closed .

The issue seems to be general with all plugins I implemented using Modals. The fix was change setReadOnly from Block component depending on the modal state (opened/closed)

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hi @HakimJu. Our Stalebot closed this issue automatically, but I reopened because it's in our schedule and we'll take a look at it soon. :)

Hi, @HakimJu the setReadOnly and setInitialReadOnly are available in props.blockProps. You can use them to manipulate the editor's editable state as requested.