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 utility returns wrong sizes in case of sequenced range #7838

Closed
mlewand opened this issue Aug 13, 2020 · 0 comments · Fixed by #7840
Closed

Rect utility returns wrong sizes in case of sequenced range #7838

mlewand opened this issue Aug 13, 2020 · 0 comments · Fixed by #7840
Assignees
Labels
package:engine package:utils squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@mlewand
Copy link
Contributor

mlewand commented Aug 13, 2020

📝 Provide detailed reproduction steps (if any)

While working on #7705 I found out that there are cases when balloon panel being mispositioned, due to the fact that the Rect utility cares only for the first range's client rectangle (while it can contain multiple).

Example repro case:

  1. Open https://ckeditor.com/docs/ckeditor5/19.0.0/features/link.html
  2. Focus the first editor.
  3. Make the following selection The [capital] city
  4. Bold it.
  5. Make a wider selection, e.g. The [capital city of Malta is the top destination this summer.]
  6. Use the link button to open link balloon.

✔️ Expected result

The balloon points to the middle of selection.

❌ Actual result

The balloon point to the beginning of the selection.

Reason is that it contains multiple boxes, the first of which (on chrome from my testing is often) 0px width, thus it points to the very beginning.

📃 Other details

  • Browser: Any
  • OS: Any

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

@mlewand mlewand added type:bug This issue reports a buggy (incorrect) behavior. package:engine package:utils squad:core Issue to be handled by the Core team. labels Aug 13, 2020
@Reinmar Reinmar added this to the iteration 35 milestone Aug 14, 2020
niegowski added a commit that referenced this issue Aug 17, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fix (utils): `Rect` utility returns wrong sizes in case of a sequenced range. Closes #7838.

Feature (utils): Introduced the `Rect#getBoundingRect()` method that returns a `Rect` instance containing all other rectangles. Closes #7858.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine package:utils squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants