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

fix: popup glitches caused by long calculations #4511

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

euaaaio
Copy link
Contributor

@euaaaio euaaaio commented Feb 4, 2024

Contribution checklist

Brief description

When we open a popup, fitPopupPositionedElement is called several times for multiple reasons, which calculates the position of the popup on the screen:

  1. Once after the DOM element is rendered and we have the reference.
  2. Twice after dispatching the changeContent event from the CreateIssue component.
  3. Once after calling resizeObserver from PopupInstance.

The problem is that we get the popup sizes too late, just from resizeObserver. This causes incorrect calculations of the left: calc(50% - -0.5px) parameter.

I suggest setting the initial sizes as soon as the DOM element is ready.

Screencast

bold-fixed-issue-popup-glitches.mov

Checklist

  • - UI test added to added/changed functionality?
  • - Screenshot is added to PR if applicable ?
  • - Does a local formatting is applied (rush format)
  • - Does a local svelte-check is applied (rush svelte-check)
  • - Does a local UI tests are executed UI Testing
  • - Does the code work? Check whether function and logic are correct.
  • - Does Changelog.md is updated with changes?
  • - Does the translations are up to date?
  • - Does it well tested?
  • - Tested for Chrome.
  • - Tested for Safari.
  • - Go through the changed code looking for typos, TODOs, commented LOCs, debugging pieces of code, etc.
  • - Rebase your branch onto master and upstream branch
  • - Is there any redundant or duplicate code?
  • - Are required links are linked to PR?
  • - Does new code is well documented ?

Related issues

Resolves #4510

Contributor requirements

  • - Sign-off is provided. DCO
  • - GPG Signature is provided. GPG

Signed-off-by: Eduard Aksamitov <e@euaaaio.ru>
@haiodo haiodo merged commit 889f83f into hcengineering:main Feb 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Popup glitches
2 participants