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

Editor: Value is not set to null if quill content is e.g. <h2><br></h2> instead of <p><br></p> #14864

Closed
dorthrithil opened this issue Feb 23, 2024 · 2 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working

Comments

@dorthrithil
Copy link
Contributor

Describe the bug

The primeng quill wrapper can correctly set the ng controls value to null in case the html content of quill is <p><br></p>. However when pasting smth like <h2>Title</h2> and deleting it again, quills internal "empty" placeholder is not <p><br></p> but <h2><br></h2>. primeng only checks for the paragraph case, so this case is not recognized as empty and required validators that check for '' or null don't work as expected.

I added a reproducer where I initialized the form with <h2><br></h2>. Pasting the content results in the same issue. Type something, delete it again: the h2 stays and quill doesn't recognize the editor as empty.

Environment

Quill 1.3.7

Reproducer

https://stackblitz.com/edit/github-isihci-fen4k8?file=src%2Fapp%2Fapp.component.html

Angular version

17.2.2

PrimeNG version

17.7.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

Not applied

Browser(s)

No response

Steps to reproduce the behavior

See reproducer

Expected behavior

The wrapper recognizes actually empty content as empty and writes null to the controls value.

@dorthrithil dorthrithil added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 23, 2024
@dorthrithil dorthrithil changed the title Editor: Value is not set to null if e.g. <h2> was deleted with backspace Editor: Value is not set to null if quill content is e.g. <h2><br></h2> instead of <p><br></p> Feb 23, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 26, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.Future milestone Feb 26, 2024
@ThoSap
Copy link
Contributor

ThoSap commented Jul 4, 2024

@dorthrithil can you try https://github.com/primefaces/primeng/releases/tag/17.18.3, now Quill 2.X.X (currently 2.0.2) is supported.
It could be that this fixes your issue, but I did not verify.

@mehmetcetin01140
Copy link
Contributor

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

@github-project-automation github-project-automation bot moved this to Done in PrimeNG Dec 16, 2024
@mertsincan mertsincan removed this from PrimeNG Dec 16, 2024
@mertsincan mertsincan removed this from the 19.x milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants