rich-text editor: onTextChange called on initialization when value exist #4674
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
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")
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:
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
=The text was updated successfully, but these errors were encountered: