-
Notifications
You must be signed in to change notification settings - Fork 4.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
Rich text: only selectively handle keyup/pointerup #48385
Conversation
Size Change: +158 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in d16ec3e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4261721487
|
e6cffa5
to
0381c93
Compare
|
||
function onUp() { | ||
onCancel(); | ||
ownerDocument.dispatchEvent( new Event( 'selectionchange' ) ); |
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.
What happens when the "selection" doesn't change, should we guard against it?
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.
Updated it. While I don't see an improvement in performance, we're still reducing the amount of times createRecord
is called and I like this isolated polyfill approach making it clearer what is happening.
What?
Sometimes some browsers are not firing a
selectionchange
event when changing the selection by mouse or keyboard. This hook makes sure that, if we detect noselectionchange
orinput
event between the up and down events, we fire aselectionchange
event.Why?
Performance
How?
Testing Instructions
E2e tests should pass.
Testing Instructions for Keyboard
Screenshots or screencast