Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Working attempt at fixing Android bugs #1774

Closed
wants to merge 18 commits into from

Conversation

aminland
Copy link

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?

aminland and others added 3 commits March 13, 2018 18:15
* 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
@facebook-github-bot
Copy link

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);
Copy link
Author

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.

Copy link
Author

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.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@mxstbr
Copy link

mxstbr commented May 27, 2018

Going to test this in our codebase!

bchmn pushed a commit to wix-incubator/draft-js that referenced this pull request Oct 14, 2018
@fabiomcosta
Copy link
Contributor

@mxstbr did you have a chance to test this one?
I'm planning on working on the Android fix, and I'm trying to see what's the best way to get started.
I know SlateJS implemented a fix that seems pretty solid recently, but didn't merge it yet, ianstormtaylor/slate#2565, so I think I'll be using that as the base of my attempt to fix this, but if this PR helps, it would be helpful to know.

{outputBlocks}
</ContentWrapper>
</div>
);
Copy link
Contributor

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?

@aminland
Copy link
Author

closing in favor of PR by @fabiomcosta

@aminland aminland closed this Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants