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

rich-text editor: onTextChange called on initialization when value exist #4674

Closed
tleveque23 opened this issue Dec 15, 2017 · 0 comments
Closed
Assignees
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@tleveque23
Copy link

tleveque23 commented Dec 15, 2017

There is no guarantee in receiving a response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeNG PRO Support where support is provided within 4 business hours

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
http://plnkr.co/edit/UkMtjkcVS2Xz0klZu6Ha?p=preview

Current behavior
When an editor (rich-text) component is initialized, if there is already some text in the model, the onTextChange callback is called.

Expected behavior
It should only be called when the text in the editor actually change.

Minimal reproduction of the problem with instructions
See the plunker. The counter is initialized to 0 but it is incremented right away to 1 on load:
http://plnkr.co/edit/UkMtjkcVS2Xz0klZu6Ha?p=preview

What is the motivation / use case for changing the behavior?
Well, we need to be able to enable a save button only when there is really a change in the editor

Please tell us about your environment:

  • Angular version: 5.1.X
  • PrimeNG version: 5.0.2
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    all

  • Node (for AoT issues): node --version =

@tleveque23 tleveque23 changed the title p-editor: onTextChange called on initialization when value exits p-editor: onTextChange called on initialization when value exist Dec 15, 2017
@tleveque23 tleveque23 changed the title p-editor: onTextChange called on initialization when value exist rich-text editor: onTextChange called on initialization when value exist Dec 15, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Pending Review Issue or pull request is being reviewed by Core Team labels Dec 19, 2017
@cagataycivici cagataycivici modified the milestones: 5.FUTURE, 5.1.0-RC1 Dec 19, 2017
@cagataycivici cagataycivici self-assigned this Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team 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

2 participants