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

Fix Android input bugs #1672

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Fix Android input bugs #1672

wants to merge 13 commits into from

Conversation

mxstbr
Copy link

@mxstbr mxstbr commented Feb 28, 2018

Summary

Merges master into #1419 and removes (now) unnecessary feature flags.

I know, I know @flarnie. Android support got kicked from the roadmap. I don't expect this to get merged, but I figured it'd be worth submitting it as a PR anyway now that I've spent the time to clean it up, maybe it helps somebody else. Feel free to close it!

/cc @octatone

@flarnie
Copy link
Contributor

flarnie commented Feb 28, 2018

Hi @mxstbr - so to update you, we have had some folks from Twitter show interest in improving support for Android web, and we're open to working with them to support the effort. Not to get your hopes up, but I won't close this yet. Sorry I don't have time for a full review just now though.

@mxstbr
Copy link
Author

mxstbr commented Feb 28, 2018

Amazing.

Fwiw, this doesn't work 100% but it at least makes it do people can type. Editing is still messy on Android vanilla Gboard, I'm happy to support whatever efforts are necessary to fix that.

@octatone
Copy link

octatone commented Mar 1, 2018

@mxstbr Thanks for updating the original PR

mxstbr added a commit to withspectrum/spectrum that referenced this pull request Mar 5, 2018
This uses a different PR for mobile support than the previous
version. (facebookarchive/draft-js#1672) It might work a bit better.
@ThariqS
Copy link

ThariqS commented Mar 19, 2018

thanks guys :) it looks like the main errors I'm seeing on this are with autocorrect. It's great that it works with android but sucks to have no autocorrect support. Did anyone ever get any fixes around that?

@tomkelsey
Copy link

Awesome work with this - we've been using it with great success until recently.

Unfortunately Chrome 65 seems to have introduced fun new problems with Android.

We've finally caved and now serve a plain textarea to Android as too many of our users were struggling to comment.

I haven't had time to wrap my head around it but it looks like the guys over at Basecamp have attempted to patch their trix editor to deal with the latest version of Chrome. Here's the PR:

basecamp/trix@593f0e3

@aminland
Copy link

aminland commented May 27, 2018

Please see the line here: https://github.com/facebook/draft-js/pull/1774/files#diff-4af33fa146be1b5864c8c7ee8b15ced5L187

Is there any reason we SHOULDN'T be doing this? It seems to just make everything work for me...

@octatone
Copy link

@flarnie any chance to get any movement on this pr? These fixes for android have been getting kicked around for over a year now.

@mxstbr
Copy link
Author

mxstbr commented Aug 22, 2018

@octatone see my comment above, none of the PRs actually fix composing on Android—they just make it so the editor doesn't crash, but it's still nowhere near production-ready.

@fabiomcosta
Copy link
Contributor

I'm working on a fix for Android events as well, I took some inpiration from this PR and from the Prosemirror project. The PR is: #2035

The problem with using the event.data property on Android is that you can make composition changes on multiple places, and data will always be one single string, so using it won't work well on Android.

The approach on my PR is different in that it listens to DOM Mutations between the compositionStart and End events and apply those to the contentState.
It's working pretty well! Please try it out and see if any of you can spot any issues so we can try to fix these Android issues.

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.

9 participants