fix: Allow RichTextEditor and its components to support readOnly state from draftjs editor #1884
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change leverages Editor's ReadOnly state https://draftjs.org/docs/api-reference-editor#readonly
Description
Accept disabled prop from the component and pass it down to add the moving part of the RichText Editor
When in readOnly state, all the moving part of the RTE should be non-editable. That includes text/ styling / attachments / attachment preview removal
Does this PR introduce a breaking change?
Manual testing step?
Tested:
- New ReadOnly RTE in DW
- Existing Review and Send RTE in DW
Screenshots (if appropriate):
Screen.Recording.2024-10-15.at.3.04.37.pm.mov