slate-angular icon indicating copy to clipboard operation
slate-angular copied to clipboard

Fix android keyboards

Open RaulPROP opened this issue 3 years ago • 11 comments
trafficstars

I opened this new PR with the linting changes from #210 .


This PR tries to solve the issues discussed at #194 .

It does so by updating this package to the equivalent at [email protected] (mainly the commits from this PR).


Issues this PR still doesn't solve:

  • [X] ~~When selecting something using android and GBoard (w/ english layout), when typing the characters (most of the times, not always),the caret doesn't move to the next position~~.

  • [X] ~~Using android and GBoard (w/ english layout) and pressing enter, there are some weird behaviors (duplication of blocks, messing the selection, etc)~~.

  • [ ] The test: with-angular > apply > move node to sibling when there is no common parent fails.

  • [X] ~~The test: Editable Component > should use default logic to show placeholder when set placeholder value fails~~.

RaulPROP avatar Aug 31 '22 14:08 RaulPROP

Hey @pubuzhixing8 , have you been able to check these changes?

RaulPROP avatar Sep 12 '22 14:09 RaulPROP

I have finally solved the issue with the GBoard, not android changes should properly be rendered.

The only thing left are those tests.

RaulPROP avatar Sep 14 '22 12:09 RaulPROP

@RaulPROP I'm sorry to tell you that there are still basic input issues on this PR that have not been resolved.

  • [x] Pressing enter at the end(richtext demo) throws an exception, the cursor doesn't move to the next paragraph correctly.
  • [x] Select a word, such as 'yourself' in the richtext demo, press the bold button, also throw an exception.

I still want to thank you for your contribution, can we use small steps to update, I invite you to be a collaborator first, let's discuss the plan first, and complete this big project step by step.

OS: mac Browser: chrome

pubuzhixing8 avatar Sep 28 '22 02:09 pubuzhixing8

Those two things works perfectly with my devices both on Chromium and Firefox (I have not tested this with iOS yet, but I will in the coming days).

Can you give me some insight on what device is throwing those errors? (Browser, OS, Keyboard -if using android-, etc)

RaulPROP avatar Sep 28 '22 07:09 RaulPROP

Those two things works perfectly with my devices both on Chromium and Firefox (I have not tested this with iOS yet, but I will in the coming days).

Can you give me some insight on what device is throwing those errors? (Browser, OS, Keyboard -if using android-, etc)

I have added, it is the desktop scene

pubuzhixing8 avatar Sep 29 '22 04:09 pubuzhixing8

I just tested it on a mac (Mac mini w/ M1, macOS Monterey 12.1) with Chrome, Safari and Firefox and I can not reproduce any issue.

Also tested on an iPhone (with Safari) and it seems to be working fine too.

RaulPROP avatar Sep 29 '22 07:09 RaulPROP

I just tested it on a mac (Mac mini w/ M1, macOS Monterey 12.1) with Chrome, Safari and Firefox and I can not reproduce any issue.

Also tested on an iPhone (with Safari) and it seems to be working fine too.

The problem I verified here, I entered the default branch of your repository (reach-version). Now it works fine on fix-android-keyboards-2 branch.

pubuzhixing8 avatar Sep 30 '22 03:09 pubuzhixing8

Glad to read that :) That branch is just to have a working version for the company that I work for.

Then the only issue that I can not seem to fix is the one from the tests. It looks like the editor is re-assigning an ID to the tables at some point.

RaulPROP avatar Sep 30 '22 07:09 RaulPROP

That branch is just to have a working version for the company that I work for.

I'm glad to hear that, too.

pubuzhixing8 avatar Sep 30 '22 08:09 pubuzhixing8

@RaulPROP In the past two days, I have studied the current android-compatible approach (#4988). I think its implementation is very complicated, which is equivalent to rewriting the input behavior processing under Android in a new way. At present, I have tested and found that slate-angular only has a lot of exceptions under chrome + android + gboard, and the same environment uses another input software (such as Sogou Keybaord for MIUI, a commonly used input software in China) It works fine, So I'm thinking if there is an easier way to do it. The current solution adds too many conditional judgments, which are difficult to maintain and understand.

I also read the changes to the current PR, which not only includes compatible handling of Android input behavior, but also a lot of breaking refactorings, I'm excited that you can make these changes, but I'm also worried about the impact of it, so I want to be more a good way to move forward is for us to make a list of some refactors first, and divide them into many small PRs to complete these changes, and we can have more detailed discussions. Here are my thoughts on code improvements.

As for the input processing approach under android, I think it still takes a longer period to discuss (what specific problems are there, how they happened, and how to deal with them, here). Before that, we can complete the refactoring.

pubuzhixing8 avatar Sep 30 '22 08:09 pubuzhixing8

At present, I am very careful when migrating slate-react updates, I need to confirm the problems it solves, and verify that slate-angular also has the same problems before updating, because some of slate-angular's compatibility processing is already inconsistent with slate-react.

pubuzhixing8 avatar Oct 01 '22 02:10 pubuzhixing8

fixed in PR: #227

pubuzhixing8 avatar Mar 20 '23 08:03 pubuzhixing8