Skip to content
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

fix: fix android backspace bug #5077

Merged
merged 2 commits into from
Oct 13, 2023
Merged

fix: fix android backspace bug #5077

merged 2 commits into from
Oct 13, 2023

Conversation

cristopher-iov
Copy link
Contributor

Context:

When this line editor.isComposing() is evaluated, the value returned is always false, so the code within the if is not executed and continues to the else.

This causes deleting a character on an Android device to delete the character on the right.

I was testing a bit and giving a value to the _compositionKey property fixes it.

I don't know if it's the best solution, but this could help or be a guide.

Issue: #4340

Evidence: https://www.loom.com/share/24898783cffd4023bf85460966702898

@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2023 10:05pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2023 10:05pm

@facebook-github-bot
Copy link
Contributor

Hi @cristopher-iov!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign 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 to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 3, 2023
@ivailop7
Copy link
Collaborator

ivailop7 commented Oct 5, 2023

These platform specific bugs always worry me, I wonder if a deeper bug is happening here, but don't know enough about mobile browsers and why this is not happening for iOS for example. Anyhow, please create IS_ANDROID in here: https://github.com/facebook/lexical/blob/main/packages/shared/src/environment.ts and use the variable from there in here.

@alexgleason
Copy link

Thank you for creating this PR @cristopher-iov

My users are annoyed by this bug. Merge?

@ivailop7 ivailop7 merged commit ca45b1d into facebook:main Oct 13, 2023
43 of 45 checks passed
@cristopher-iov cristopher-iov deleted the fix/MAP-235 branch October 13, 2023 14:10
@bilobom
Copy link

bilobom commented Oct 19, 2023

@ivailop7 @alexgleason
This PR is not the optimal solution , when there is one character left at any line it wont delete it and it will jump to the begining of line without deleting the character.

Evidence:
https://github.com/facebook/lexical/assets/19841175/50d93d4c-f6db-474a-bfb0-b63280e587da

@alexgleason
Copy link

The actual underlying issue here is a bug in Chromium Android, right?

Your comment here is very helpful: #1973 (comment)

Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1403455#c2

This MR is still mostly an improvement, but frustrating that mobile Chromium sucks at this. It's a big portion of my userbase.

@ivailop7
Copy link
Collaborator

Not great, let's see when this bug Chromium Android bug gets fixed and we'll revisit this. Don't know what the right answer is here.

@kirandash
Copy link
Contributor

@ivailop7 @alexgleason This PR is not the optimal solution , when there is one character left at any line it wont delete it and it will jump to the begining of line without deleting the character.

Evidence: facebook/lexical/assets/19841175/50d93d4c-f6db-474a-bfb0-b63280e587da

I was able to fix it with these code changes: #4941 (comment)
Hope it helps. If anyone has any feedback I will be happy to investigate further 🙏🏻

@kazimirchuk
Copy link
Contributor

@kirandash great job, thanks a lot! 🙇 Replied in the PR #4941 (comment) 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants