Skip to content
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

Rect#getVisible() does not work well with absolutely positioned elements #14107

Closed
oleq opened this issue May 11, 2023 · 0 comments · Fixed by #14210
Closed

Rect#getVisible() does not work well with absolutely positioned elements #14107

oleq opened this issue May 11, 2023 · 0 comments · Fixed by #14210
Assignees
Labels
package:utils squad:features Issue to be handled by the Features team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@oleq
Copy link
Member

oleq commented May 11, 2023

📝 Provide detailed reproduction steps (if any)

Consider the following structure:

<div class="parent"> (e.g. body collection container)
    <div class="child" style="position: absolute"> (e.g. a floating balloon element)

then call new Rect( child ).getVisible()

✔️ Expected result

Since the child has position: absolute and the parent has no position: relative, the child can move freely unobstructed by the parent. It will not get cropped.

But getVisible() will consider the parent nevertheless.

❌ Actual result

The parent is ignored by getVisible() logic.

❓ Possible solution

The logic of getVisible() should understand whether the child will be cropped or not. See this fiddle to learn more https://jsfiddle.net/4wnxhjf1/47/.


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

@oleq oleq added type:bug This issue reports a buggy (incorrect) behavior. package:utils squad:features Issue to be handled by the Features team. labels May 11, 2023
@oleq oleq self-assigned this May 22, 2023
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label May 22, 2023
Dumluregn added a commit that referenced this issue May 30, 2023
…position-absolute

Fix (utils): `Rect#getVisible()` should not consider ancestors when the target is an element with `position: absolute`. Closes #14107. Closes cksource/ckeditor5-internal#3264.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label May 30, 2023
@CKEditorBot CKEditorBot added this to the iteration 64 milestone May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:utils squad:features Issue to be handled by the Features team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
2 participants