facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
17.37k stars 1.43k forks source link

Feature: File upload #5885

Open HolyOne opened 2 weeks ago

HolyOne commented 2 weeks ago

I checked out the playground page and I did not see a file upload. However I can upload an image when dragged to the lexical editor.

Is there a way i can control that upload behaviour? Like speciying a custom dialog or webapi for it? Thanks

acywatson commented 2 weeks ago

There's no magic here, really. If you want to upload with a dialog, just make a button that triggers a dialog. When the upload is complete (or whenever, as your needs require) insert a Lexical node that renders an HTML img tag or something to have the image show up in the editor.

Lexical doesn't provide this out of the box, but we can leave this open as a feature request to support this better.