-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Working attempt at fixing Android bugs #1774
Conversation
* Modified compositoin mode event handlers to provide better support for mobile browsers * Added test cases for DraftEditorCompositionHandler * Linter compliance * Added support for `compositionupdate` event. * Made the linter happy! * Normalize beforeInput and compositionUpdate data This continues from facebookarchive#1152 and facebookarchive#1285 making them work together for broad support for polatform inconsistencies. * Put new composition fixes behind a feature flag * lint * correct resets * Fix Synthetic Event flow types * Convert DraftEditorCompositionHandler tests to root tests + snapshots * Remove unnecessary DraftFeatureFlags
Input bugs (#2)
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
} | ||
|
||
onInput(editor); |
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.
Is there any reason we shouldn't just call the same function that handles spellchecks? This seems to make android just work.
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.
Also i'm not sure how to test this because the jest test seem to have document.getSelection and global.getSelection = undefined. Not sure how to emulate this.
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Going to test this in our codebase! |
@mxstbr did you have a chance to test this one? |
{outputBlocks} | ||
</ContentWrapper> | ||
</div> | ||
); |
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 is this change fixing?
closing in favor of PR by @fabiomcosta |
This is a continuation off of @mxstbr input-bugs fix #1672
I found that just calling editOnInput at composition end makes android magically work. There are still a tiny bit of issues like cutting text, but I can't see any reason not to treat a compositionEnd event the same way we treat a spellcheck and read from the dom...
Thoughts?