-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 unnecessary update of ra-input-rich-text on edit #3099
Conversation
Thanks! It seems the tests are failing though |
ee086ae
to
b38e3ca
Compare
b38e3ca
to
661b8a1
Compare
Hi just want to check, did anyone take the opportunity to review the code? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll wait for another core team member to review before merging though
}); | ||
|
||
it('should call text-change event only once when editing', async () => { | ||
const mockFn = jest.fn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call it handleChange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure ? I still see mockFn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry I misunderstood, I thought you meant the test description. Will make the required change in another 3 hours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djhi done.
quill require mock on some DOM apis while in test.
1. add reason for shim 2. add reason for using jest fake timers
}); | ||
|
||
it('should call text-change event only once when editing', async () => { | ||
const mockFn = jest.fn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure ? I still see mockFn
Thanks! |
Thanks for the review and merged |
Hi,
in ra-input-rich-text,
whenever the text changes, below is the sequence of events happening.
Original text
<p>test</p>
<p>test1</p>
onTextChange
firedcomponentDidUpdate
fired<p>test</p>
, but unecessaryonTextChange
fired again.2nd issue is that, it seems quilljs is always adding additional
<p>
after this methodONLY for the text that has special characters, i.e
ARTÍCULO 1.- El presente reglamento es de observancia obligatoria
after you boldARTÍCULO 1
fixes #3073