slate icon indicating copy to clipboard operation
slate copied to clipboard

In an Android environment, if readOnly is set for Editable, Gets Editor. selection to null

Open loycoder opened this issue 3 years ago • 0 comments

Description My current hope is to get the selected content in uneditable mode, but in an Android environment, if Editable passes readOnly props, gets Editor. selection to null.

Recording By looking at the Sandbox demo, this is a guaranteed bug.

Sandbox This is sandbox demo , please access the test in the Android environment sandBox demo

Steps To reproduce the behavior: 1.For Android, select a section of content in your browser and click on the Test button to get Editor.Selection

Expectation Editor.selection can be obtained normally

Environment

  • Slate Version: [0.78]
  • Slate-react version: [0.79]
  • Operating System: [Android]
  • Browser: [All browsers on Android]

Context I looked at the slate-react source code and found that for Android special processing, By listening on onSelectchange, In onDOMSelectionChange approach, called the isTargetInsideNonReadonlyVoid () function to have such a logic:

 if (IS_READ_ONLY.get(editor)) return false   

I commented the code locally and it worked fine, but I'm not sure if there was a problem in other scenarios , Looking forward to reply. Thank you~

loycoder avatar Jun 26 '22 16:06 loycoder