-
-
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
Mention balloon panel sticks out of the limiter element while scrolling. #14662
Comments
I would still pass a first rect out of |
Do I understand correctly that this affects all contextual balloon UI elements, including table and image toolbar, and in these cases we should hide them as well? |
I checked this and the problem is exclusive to the mentions feature these days. Improvements were made to the balloon positioning recently that addressed similar problems in balloon toolbars etc. Screen.Recording.2024-01-04.at.10.58.39.movThe problem comes down to my recent comment: the positioning logic seems to ignore the fact that a DOMRect of a DOM Range (and a DOM Range itself) can have a "parent" with |
I encountered the same problem, is there any solution for this problem now? Which branch can I merge, or which part of code can I merge to solve my problem? @oleq Many thanks. |
This is an open issue, no patch was prepared for it yet. |
I saw some similar situations in #14755 , it seems to have been solved and has been merged into the master branch, I thought it might be helpful to solve this problem. If not, I will wait for a solution, the related code logic is too complicated for me. Thanks again. |
📝 Provide detailed reproduction steps (if any)
@
and scroll while balloon panel is visible.✔️ Expected result
Balloon panel should be hidden when
@
(target) is outside of the visible area (limiter)Screen.Recording.2023-07-26.at.09.16.10.mov
❌ Actual result
Screen.Recording.2023-07-25.at.15.33.43.mov
❓ Possible solution
To place the
BalloonPanelView
in best optimal position plugin is using function https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/dom/position.ts#L88 that is trying to return the best fit of theelement
into thelimiter
andviewport
. To get the intersection (limiter) of alltarget
scrollable ancestors we're using function https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/dom/getscrollableancestors.ts which takes only one parameter -HTMLElement
, the problem is thatMentionUi
sets the target as aRect
no as aHTMLElement
- that's why the only limiter iswindow
and the optimal position is calculated wrongly.Potential solution is to pass the DOM element
domConverter.viewRangeToDom( viewRange )
from this line 👉 https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-mention/src/mentionui.ts#L557 but this need to be prototyped and well tested.📃 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: