Fix selection coordinates in mobile
Because the HTML editor is different, we need a different selector to get the editable element. We also need to add a small offset to the coordinates to avoid positionning the overlay icon above native selection UI in mobile. For example, Android adds a marker at the beginning and the end of the selection and we do not want to display the Scribe overlay icon above this marker.
This commit is contained in:
@@ -66,7 +66,7 @@ class _MobileEditorState extends State<MobileEditorWidget> with TextSelectionMix
|
||||
_editorController = editorApi.webViewController;
|
||||
|
||||
registerSelectionChange =
|
||||
HtmlUtils.registerSelectionChangeListener(_createdViewId);
|
||||
HtmlUtils.registerSelectionChangeListener(_createdViewId, isWebPlatform: PlatformInfo.isWeb);
|
||||
|
||||
_editorController?.addJavaScriptHandler(
|
||||
handlerName: registerSelectionChange!.name,
|
||||
|
||||
Reference in New Issue
Block a user