suneditor icon indicating copy to clipboard operation
suneditor copied to clipboard

[Question] Creating custom plugins with React?

Open nesh325 opened this issue 3 years ago • 4 comments

Is there a way to make custom plugins that would open up a react component instead of the html dialogs from within the plugin?

A possibility I'm seeing is using the html dialogs but have them visibly hidden. Then use a mutation observer that checks if the display is toggled for that dialog. Then query that dialogs inputs to get the values, manipulate it with the react component and insert it back into the dialog. Then finally triggering the 'submit' button from the html dialog.

Is this a good approach or is there a way to use React instead ?

nesh325 avatar Aug 21 '22 16:08 nesh325

Do you mean using dialogs by replacing them with React components?

JiHong88 avatar Sep 06 '22 09:09 JiHong88

Do you mean using dialogs by replacing them with React components?

Yes, exactly this

nesh325 avatar Sep 06 '22 15:09 nesh325

Um..I can't even think of a way right now. :( It's a complicated problem.

JiHong88 avatar Sep 08 '22 08:09 JiHong88

@JiHong88 Any way to custom UI and logic of insert image dialog plugin default? Now I am trying to create an custom plugin to overwrite it but it show error can't open dialog. image image I don't see the image dialog section in custom plugin docs here: http://suneditor.com/sample/html/customPlugins.html

trungdinhngoc avatar May 08 '24 03:05 trungdinhngoc