-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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(popover): popover positions correctly on all frameworks #26306
Conversation
raf(() => { | ||
raf(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to wait 2 frames just in Ionic Vue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short answer, I'm not sure. I tested with a single request animation frame delay and compared against each and only Vue did not render the inner contents in time for the transition. Bumping to two consistently rendered correctly. I'm not familiar to the internals of how Vue handles rendering.
My intention with this bug fix is looking at a target for a patch release, but realizing we should be able to rip most/all of this away in a minor or major release, if we change either or both:
- The animation library to support asynchronous behavior.
- Add support to overlays to accurately track when content is mounted before running the transition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the changes since they resolve some critical popover functionality. Can we add a tech debt ticket to research alternative implementations that do not rely on dual rafs?
Created FW-2875 to track, with additional detail as to what the problem we need to solve for is. |
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
In framework implementations, the popover will incorrectly position when using an alignment property such as
top
orbottom
. The delay in timing between when the popover contents are mounted in the DOM vs. when the transition starts is too low, resulting in the popover content's bounding box height evaluating to0
and the popover positioning incorrectly.Issue URL: #25337
What is the new behavior?
ionMount
internal event when the popover is presented instead ofwillPresent
. This allows the framework to mount the popover content earlier in the lifecycle of an overlay being presented.Does this introduce a breaking change?
Other information
Dev-build:
6.3.8-dev.11668643678.159ccab8