-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
@@ -40,7 +40,7 @@ function editOnInput(): void { | |||
var domSelection = global.getSelection(); | |||
|
|||
var {anchorNode, isCollapsed} = domSelection; | |||
if (anchorNode.nodeType !== Node.TEXT_NODE) { | |||
if (anchorNode.nodeType !== Node.TEXT_NODE && anchorNode.nodeType !== Node.ELEMENT_NODE) { |
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 this ok?
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's the scenario here? For Android text replacement, the span
can be the anchor node?
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.
No idea, it just happens. Will check more carefully next time I debug draft-js
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.
Were you able to get more details on this case?
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 - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
@@ -88,7 +88,7 @@ function editOnInput(): void { | |||
|
|||
var anchorOffset, focusOffset, startOffset, endOffset; | |||
|
|||
if (isGecko) { | |||
if (true || isGecko) { |
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.
I need to find how to check for chrome under Android
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
let selection = editorState.getSelection(); | ||
//let selecti | ||
if (formerComposedChars) { | ||
if (selection.isCollapsed()) { |
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.
Nit: Combine conditionals.
This fixes an issue on Android. It looks ok for others browser also
4fdc94a
to
d6bb473
Compare
Ok, I'm going to import this and do some testing. |
@facebook-github-bot import |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
👍 |
What's the status on this one, @hellendag? Would be nice to improve the Android support. |
Patching and testing. |
@@ -21,7 +21,7 @@ var findAncestorOffsetKey = require('findAncestorOffsetKey'); | |||
var nullthrows = require('nullthrows'); | |||
|
|||
var isGecko = UserAgent.isEngine('Gecko'); | |||
|
|||
var isAndroid = UserAgent.isPlatform('Android'); |
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.
Can we be more specific about targeting browser engines? Or does this need to apply across Android?
It looks like calling restoreEditorDOM setState changes the active element from the div -> body -> div rapidly. This causes the keyboard to close. Saw this by monitoring the documents focusin/focusout events. It looks like it closes in react.js right after .$editor0 node is removed. React removes the entire This is caused by... Which it looks like is used to force a complete re-render. @hellendag - moving Why force the re-render of everything, and not just the data-contents? I've created a pull request #572 to illustrate the changes. |
Is there any update on this? I could really do with this Android keyboard issue being resolved. Thanks |
What is the status on this? Do you need help testing? |
Hi, I also have some text composition issues on iOS devices, are these issues related?#626 |
for adding myself to participants |
@hellendag @cgestes is there any word on when this might land? it's blocking us from implementing Draft in our codebase. |
We're also waiting anxiously for this, commenting for notifications, apologies for noise. |
@pklingem If you want notifications without giving everyone "noise", you could just press the Subscribe button on the right sidebar of any issue... |
thanks @kevinmartin I just clicked subscribe. |
please some one merge this PR? |
I've ran into this issue when porting my app to Cordova. I was a bit surprised to discover that draft doesn't support Android. Now this issue is the only thing blocking us from releasing our app. |
Hi @cgestes , it looks like this pull request has been abandoned, so I am going to close it. If someone is still interested in working on this please feel free to reopen it! |
Based off facebookarchive#175, this commit fixes some issues with autocomplete behavior on Android Chrome.
This fixes some issues for chrome support on Android. (including crosswalk)
remaining issues:
I believe this can be merged after review without waiting for the other fixes. The experience is already much improved.