react-email-editor icon indicating copy to clipboard operation
react-email-editor copied to clipboard

how to change displayMode

Open doudoucomic opened this issue 5 years ago • 11 comments

i want 'web' mode. but in react .i can't find this props?how to change?thanks

doudoucomic avatar Jun 18 '19 07:06 doudoucomic

@doudoucomic you need to change this code or
set options parameter with displayMode: "web"

derit avatar Sep 29 '19 16:09 derit

Would be better if that could be passed through with a property. otherwise this will vanish from your application should you ever decide to update your third party components.

RaptorRob avatar Oct 08 '19 14:10 RaptorRob

i was create a pull request for provide this issue, look that https://github.com/unlayer/react-email-editor/pull/93

derit avatar Oct 08 '19 15:10 derit

The project name is react-email-editor 😃 if they offer this possibility then they should rename the project

lidrissi avatar Oct 08 '19 15:10 lidrissi

Hi @derit i wonder why passing a displayMode params to options doesn't work for me. <EmailEditor options={{ safeHtml : true, displayMode : "web" }} ref={emailEditorRef} onLoad={onLoadEditor} tools={{ html: { enabled: true } }} /> do you have any idea ? thanks.

dimasabimanyy avatar Sep 20 '21 01:09 dimasabimanyy

@dimasabimanyy my merge request currently still open, you can't change display mode

mr ku belum di merge mas

see this change, you can clone my code and add to your project https://github.com/derit/react-email-editor/commit/02d900ddbae186fc7b1502b2fdd98046d199c83b

derit avatar Sep 20 '21 01:09 derit

You can fork the plugin and replace the following line to make the editor work in 'web' mode:

https://github.com/unlayer/react-email-editor/blob/master/src/index.js#L58

alina-unlayer avatar Sep 21 '21 10:09 alina-unlayer

Can we please get this fixed and supported? I cannot believe you are hardcoding displayMode to email and not allowing us to use web.

btknorr avatar Apr 14 '23 19:04 btknorr

As a paid embed and an active PR its mad i still have to fork this to fix a hard coded parameter

rossWewing avatar May 09 '23 11:05 rossWewing

@adeelraza not sure if you are unlayer team, but since I saw you merge few PRs. Please consider merging this as well

rakeshmukundan avatar Jun 08 '23 20:06 rakeshmukundan

I didn't test this well (or really at all), but I think all you need to do is move the ...options down to after the last key in the object that gets passed into createEditor(). This way any user provided values will override default values:

https://github.com/dmost714/react-email-editor/commit/a0c2c182850dfa51991f878cd579deb974b8a202

dmost714 avatar Jun 08 '23 20:06 dmost714