tinymce / tinymce-blazor

Blazor integration
MIT License
45 stars 14 forks source link

Form validations #30

Closed rexebin closed 2 years ago

rexebin commented 2 years ago

Thanks for providing the Blazor integration.

I ran into issues when I use this component, it is difficult to get the validation behaviours like Blazor's build in form components. Like trigger validations on change or on input, add and remove CSS classes to show validation states etc.

So I created a component intended to use in Blazor's EditForm component with the above-mentioned validation behaviours, inherits TinyMCE.Blazor.Editor class. It is now available as a NuGet package named InputTinyMCEEditor.Blazor.

In dotnet 6, with JavaScript initializer, the step of loading tinymce-blazor.js manually is redundant if the name is changed {NAME}.lib.module.js. I think it's worth doing for tinymce-blazor.

exalate-issue-sync[bot] commented 2 years ago

Ref: INT-2724

jscasca commented 2 years ago

Hey @rexebin that looks great!

At first I wasn't sure how people were going to use this component so it might feel bare bones but suggestions like this are greatly appreciated to improve on the component. I will try to add both the validations and js library new name to the next release.

Thanks!

rexebin commented 2 years ago

If you accept PR, I can submit one for the mentioned enhancement.

Is there a better way to hook up events than using a default 'setup' script? Because there is a risk that the users might override them without knowing.

jscasca commented 2 years ago

Of course, feel free to submit PRs any time!

rexebin commented 2 years ago

Is it ok to upgrade the project to dotnet 6?

rexebin commented 2 years ago

I don't know how it will affect existing users with a lower version of dotnet, we have to be careful here.

jscasca commented 2 years ago

Might be better to keep it in dotnet 5 so current users who have not migrated are not impacted.

rexebin commented 2 years ago

PR submitted. support for dotnet 5 is kept and added dotnet 6. I have to remove dotnet standard 2.0 because it is not compatible for dotnet 6.

jscasca commented 2 years ago

I merged the PR and we are waiting for an update to the CI so that we can build and release with these changes. I will update this issue when the release is ready

jscasca commented 2 years ago

This was released on v0.0.9. Thanks for all the hard work!