Open JoelAShepherd opened 1 year ago
I have a similar requirement to disable text input in my Next.js project - I'd like to keep the toolbar active since I want for example the Preview button to be visible and enabled so that the user can preview the text but not enter any text changes,
This is the way to disable input in Next.js:
const [simpleMDEEvents, setSimpleMDEEvents] = useState<SimpleMdeToCodemirrorEvents>({
beforeChange: (instance: any, changeObj: any) => {
console.log("beforeChange", changeObj);
changeObj.canceled = true;
},
});
<SimpleMDE
id="someid"
value={somevalue}
options={mdeOptions}
events={simpleMDEEvents}
/>
I'm using EMDE as part of a form. There are points in the process when I want the MDE to be disabled, so the text is visible but not editable. I can't currently see an option for this