diff --git a/src/components/MegadraftEditor.js b/src/components/MegadraftEditor.js index 7a70a57b..ff0637cd 100644 --- a/src/components/MegadraftEditor.js +++ b/src/components/MegadraftEditor.js @@ -98,19 +98,20 @@ export default class MegadraftEditor extends Component { for (let [blockType, data] of DefaultDraftBlockRenderMap.entrySeq()) { r.set(blockType, { ...data, - wrapper: this.props.movableBlocks ? ( - - ) : ( - - ) + wrapper: + !this.props.readOnly && this.props.movableBlocks ? ( + + ) : ( + + ) }); } }); diff --git a/tests/components/MegadraftEditor_test.js b/tests/components/MegadraftEditor_test.js index 848ef249..7525cc78 100644 --- a/tests/components/MegadraftEditor_test.js +++ b/tests/components/MegadraftEditor_test.js @@ -838,6 +838,18 @@ describe("MegadraftEditor Component", () => { ); }; + it("should not render MoveControl when readOnly is present", () => { + const wrapper = mount( + + ); + expect(wrapper.find(".move-control").exists()).toBeFalsy(); + }); + it("with the top block by clicking the up control", () => { const expected = [ "block-kst0",