ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

[iOS] The selection is visible over editor UI

Open Mgsy opened this issue 6 years ago • 4 comments

📝 Provide detailed reproduction steps (if any)

Edit: 15.09.2022

  1. Go to https://ckeditor.com/docs/ckeditor5/latest/examples/builds/document-editor.html.
  2. Create a non-collapsed selection at the beginning of the editable.
  3. Open the headings dropdown.
  4. Try to click on a dropdown item.

✔️ Expected result

It's possible to pick an option from the dropdown.

❌ Actual result

The native selection appears and it's impossible to pick an option from the dropdown.

📃 Other details

test

  • Browser: Safari
  • OS: iOS
  • CKEditor version: Latest master

More examples:

  • ckeditor/ckeditor5#7497
  • ckeditor/ckeditor5#11217

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

Mgsy avatar Nov 19 '19 09:11 Mgsy

This is a known bug in iOS. The only way to address this is by blurring the text field the selection is rendered in.

@ckeditor/qa-team  Can you confirm this happens less often since ckeditor/ckeditor5#11838? The editing root gets blurred now and the focus moves to the dropdown making the selection disappear.

oleq avatar Sep 08 '22 08:09 oleq

@ckeditor/qa-team  Can you confirm this happens less often since #11838? The editing root gets blurred now and the focus moves to the dropdown making the selection disappear.

I can't reproduce this issue anymore, after opening the dropdown, the selection moves to it and is invisible in the editable.

Mgsy avatar Sep 13 '22 09:09 Mgsy

This is awesome news :) I haven't thought about this side-effect of our recent changes.

Reinmar avatar Sep 14 '22 08:09 Reinmar

Unfortunately, the issue still exists :cry: For the non-collapsed selection, after moving the focus to the dropdown, the native selection is invisible, but it appears again after clicking on a dropdown item.

I've edited the first post and added the image showing the problem.

Mgsy avatar Sep 15 '22 11:09 Mgsy

The current behavior is a bit different (iOS 16.5). The selection after opening the dropdown is not visible, but you still cannot select options. Sometimes it works when I bash multiple times on the screen or probably when the option is above the select (paragraph's case). Recording:

https://github.com/ckeditor/ckeditor5/assets/9881379/0d5c6ea1-b118-4e69-9c3e-65260e0e63fa

Witoso avatar May 22 '23 07:05 Witoso

Ideas:

  • on the renderer level, remove DOM selection while editable is blurred.
  • maybe there are some APIs that we could use?
  • higher z-index on iOS on dropdown?

Witoso avatar May 22 '23 08:05 Witoso

  • on the renderer level, remove DOM selection while editable is blurred.

We actually do a similar thing in the link feature. The selection that you see on a link when you edit it is a fake marker. You can tell because the selection slightly changes its color and size depending on the OS when you open the link UI. We did that to maintain the UX. Otherwise, the selection in the editing root would disappear (DOM focus goes to the link UI) and, after a short while, it would be hard to tell what is getting linked and where.

This is not a system-wide solution, though (ATM only limited to links). But if we managed to have it available for all features, then we could control the z-index of the fake selection marker and probably work around the original issue. This would probably be handled on the global editor FocusTracker level: if the focus remains in the editor but not in the editing root, then render a fake selection.

image
  • maybe there are some APIs that we could use?
  • higher z-index on iOS on dropdown?

Sadly, this whole thing has nothing to do with z-index. Rendering the selection over everything is happening on the OS-level and there's nothing we can do about it in CSS.

oleq avatar May 23 '23 09:05 oleq

Scope:

  • Extending the mechanism of fake selection (make it more generic and part of the core). The same for all browsers.
  • Only iOS onBlur or always switch to fake selection when we move to some inputs?

Witoso avatar May 24 '23 08:05 Witoso