editablejs / editable

🌱 A collaborative rich-text editor framework that focuses on stability, controllability, extensibility, and performance. 一款强到离谱的富文本编辑器框架,专注于稳定性、可控性、扩展性和性能。
https://docs.editablejs.com
Apache License 2.0
1.81k stars 120 forks source link

Unable to select on Android + Chrome browser #84

Closed aslafy-z closed 1 year ago

aslafy-z commented 1 year ago

Description I'm not able to select text by pressing it on Chrome for Android. The keyboard opens up / closes instead of selecting.

Recording https://user-images.githubusercontent.com/8191198/217819460-f61806c3-676b-469b-9d18-1582fc126e0d.mp4

Sandbox https://docs.editablejs.com/playground

Steps To reproduce the behavior:

  1. Go to the sandbox
  2. Long press on text
  3. Text does not select

Expectation The text should be selectable with the default android tooling.

Environment

big-camel commented 1 year ago

The issue here is that the default toolbar is not displayed because the current cursor is drawn using a div and we have not used contenteditable to make the editor editable, so the browser is unable to get the editor's selection object.

Then the long press behavior here should still be the behavior on the pc browser, it opens the right-click menu. Selecting nearby text after a long press is more in line with mobile behavior. Here, a PR is needed to fix it.

You can try to click twice continuously (double-click), it should select a word near the click. However, the drag and drop after selection is still buggy and I will fix it as soon as possible.

big-camel commented 1 year ago

https://github.com/editablejs/editable/pull/86