Open arjungithub1199 opened 3 years ago
I have the exact same issue, wondering how I can just force it to _blank or any way to get around this problem.
Ok, in my case I was using DOMPurify and that was causing the issue. Otherwise the option works fine.
Add this where you are using DOMPurify:
DOMPurify.setConfig({ ADD_ATTR: ['target'] }); //allow "open in new window" html link targets
Add this where you are using DOMPurify:
DOMPurify.setConfig({ ADD_ATTR: ['target'] }); //allow "open in new window" html link targets
Where do I have to add this line?
When there are multiple links created in the editor, all the tabs gets opened in the same tab. The first link always open a new browser window, but the subsequent link will replace the first window and open up there. This behavior is even after setting defaultTargetOption: "_blank".
The issue can be replicated in the demo section by creating 2 links - https://jpuri.github.io/react-draft-wysiwyg/#/demo
Below is the piece of code I used to create the editor