-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-root editor: cannot focus root which has only block widget inside #16806
Comments
It does not need to ba a table, it can be anything that selected got a toolbar/tooltip; for example an image: Screen.Recording.2024-07-26.at.13.20.09.mov |
@FilipTokarski / @pszczesniak I checked it on Firefox, on latest docs, and I'm not able to reproduce this issue. Can you still reproduce this? |
@Mati365 yes i can (Chrome). |
On Firefox it works as expected. |
SummaryClicking on element with Debug notes
so it's performing fallback to previously focused node
|
I stumbled upon this same issue today. I prepared demo for rerepo and then found this issue... Anyway, I'll share it, maybe it could be helpful - https://stackblitz.com/edit/1haefu?file=main.js. Screen.Recording.2024-08-09.at.16.22.33.movWhat' interesting here is the other part of this issue (however, I'm not 100% sure if it's the same cause) is how document selection updates when you focus and then deselect different roots. AFAIU selecting the root (and then deselecting it) should result in document selection ( Screen.Recording.2024-08-09.at.16.35.05.mov@Mati365 maybe it could be worth checking, but if it's something different I can extract to a separate issue. |
@f1ames That's the same issue. I suspect that Chrome is not firing the selection change event properly after focusing editable that contains block element. So we have focus but there is no selection, and the editor is trying to fall back to the last known focused element because editable does not contain any cursor. The funny thing is that forcing chrome to focus first block or contenteditable element works. I extracted the issue to bare minimum HTML here: https://stackblitz.com/edit/stackblitz-starters-lf3smh?file=index.html So on Firefox it used to work ok: stackblitz-selection-2024-08-09_16.54.24.mp4but on Chrome: stackblitz-selection-chrome-2024-08-09_16.55.51.mp4 |
📝 Provide detailed reproduction steps (if any)
✔️ Expected result
Focus should stay in the root, similarly to a "standard" editor:
Screen.Recording.2024-07-26.at.12.55.51.mov
❌ Actual result
Focus jumps back to the other root, it's not possible to focus a root which has only block widget:
Screen.Recording.2024-07-26.at.12.54.42.mov
❓ Possible solution
If you have ideas, you can list them here. Otherwise, you can delete this section.
📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: