Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle empty value returned by getSemanticHTML #1841

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

cexbrayat
Copy link
Contributor

A regression was spotted by our team when updating to the lastest ngx-quill version, where required form controls applied on quill editors were no longer be marked invalid when emptied.

It looks like getSemanticHTML() can return <p></p> when the editor is emptied (at least when it is emptied programatically using setText('')). This commit augments the "empty" check to handle this possible value and <div></div>. A unit test has been added to reproduce this issue.

A regression was spotted by our team when updating to the lastest ngx-quill version, where required form controls applied on quill editors were no longer be marked invalid when emptied.

It looks like `getSemanticHTML()` can return `<p></p>` when the editor is emptied (at least when it is emptied programatically using `setText('')`).
This commit augments the "empty" check to handle this possible value and `<div></div>`.
A unit test has been added to reproduce this issue.
@KillerCodeMonkey
Copy link
Owner

@cexbrayat thanks i had this on my todo list as next bullet point to solve :D, because i saw this in in my demo repo, that the empty handling changed.

@KillerCodeMonkey KillerCodeMonkey merged commit 0fd0cf8 into KillerCodeMonkey:master Apr 23, 2024
1 check passed
@cexbrayat cexbrayat deleted the fix/empty-value branch April 23, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants