Blazored / TextEditor

Rich text editor for Blazor applications - Uses Quill JS
MIT License
276 stars 58 forks source link

Added bind value support #42

Closed dustout closed 3 years ago

dustout commented 3 years ago

Added support for bind-value. This allows the editor to work closer to the way InputText and the other form components work

ADefWebserver commented 3 years ago

Good work, your code looks great.

However, I'm sorry but I can't accept this pull request.

The reason is that I do not believe it is a good thing to marshal data from the Quill JavaScript component to the Blazor app on each quill.on('text-change'...

Thank You!

dustout commented 3 years ago

I agree that when users are typing a novel it would have a performance hit, but most users are just typing a comment and this change makes that flow work pretty smoothly.

Thanks anyways, and also big thanks for the blazored tools in general, your modal is leagues above the other blazor modals!

dustout commented 3 years ago

In case you change your mind I just pushed a bug fix where the bind was not properly setting the value

https://github.com/dustout/TextEditor/commit/9b8d297fe0c00298f0c00b011ec8ed0acc4a8727

ADefWebserver commented 3 years ago

@dustout You can fork the code and release your own version. Just use a different name for your project. Thanks!

axedaddy commented 12 months ago

Check out my (rejected) repo https://github.com/Blazored/TextEditor/pull/66. It binds the value when the quill editor looses focus (onBlur). Extensively tested, however there are 2 outstanding issues.

  1. If the onBlur function doesn't exist as a JSInterop in c#, then the call from js logs an error. I would have liked a way to check if the function exists before calling but was unable to find a solution.
  2. The initial load of Html into Quill throws an exception first time. 2nd time is OK. I was unable to determine the cause of this.

I added a sample project which demonstrates it usage.

ADefWebserver commented 12 months ago

@axedaddy - .Net 8 changes the way things are rendered. It may be possible to resolve these issues with .Net 8. It may be possible to resolve these issues by turning off prerendering or setting static rendering mode.