-
-
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
Viewport offset aware and sticky positions #10373
Conversation
@ckeditor/qa-team Can you give us a hand with this PR? The impact of these changes is huge: we touched the mechanics of positioning balloons/popups/floatables across the entire project (also CF). |
What about cases when toolbar wrapping is disabled? Or when using other toolbar items when table is focused? Currently table toolbar is always on top and covers other balloons, making some options unreachable. Not sure if this is a discussion for this PR, but anyway, such cases might be annoying when editing some bigger content, as the table toolbar is now always visible on scroll. 0_toolbar2.mp4 |
Steps:
Result:URL balloon will change to table toolbar, but its position will stay next to the link. This toolbar can be scrolled out of the viewport. Changing the caret position once again with arrow keys will fix the table toolbar placement. CKE5-link-ballon-viewport.mp4 |
…ocusing out of the editor
@FilipTokarski @LukaszGudel Thanks for looking at this. Just to make sure I addressed all the issues you raised:
@ckeditor/qa-team Could you quickly re-test this thing with everything I posted above in mind? |
Changes had been made and we have green light from Olek already.
LGTM 👍 |
Thank you all :) It's been a long ride, but an interesting one. I scanned most of the code changes and they look really nice. I was surprised, but I didn't actually spot breaking changes except one (in the widget package). The changes in utils seem to be backwards compat because the new Position class is compatible with the old typedef and the Once again, thank you and congrats 👏 |
This PR aims to fix contextual balloons positioning constraints if
viewportOffset
is specified.Currently if on a page there are any absolutely positioned UI elements, some balloons can go above or under these elements. See #9892 for more information about it.
There are two subproblems to solve in this case:
getOptimalPosition
) to only consider positions within an area limited by the newly addedviewportOffset
config option.sticky
. To stick to the top of the constrained viewport for very tall elements and widgets (taller than the editor viewport).It's heavily inspired by #10239 and it invalidates both #10239 and #10120.
Also, it probably will have to be slightly modified when #10352 lands in master because it independently adds the concept of
ui.viewportOffset
config property.Suggested merge commit message (convention)
Type: TODO: I will need help with this message. There are probably a lot of breaking changes here. Closes #9892.
Additional informations
Best test to check it out is: