-
Notifications
You must be signed in to change notification settings - Fork 378
fix(Popper): prevent flash of incorrectly positioned popper on open #12177
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
base: main
Are you sure you want to change the base?
Changes from all commits
5f4c037
c758eaa
1bb6a2b
97c8cfc
161cb88
a9a1aaf
cea95fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -524,6 +524,17 @@ export const clearTimeouts = (timeoutRefs: React.RefObject<any>[]) => { | |
| }); | ||
| }; | ||
|
|
||
| /** | ||
| * @param {React.RefObject<any>[]} animationFrameRefs - Animation frame refs to clear | ||
| */ | ||
| export const clearAnimationFrames = (animationFrameRefs: React.RefObject<any>[]) => { | ||
| animationFrameRefs.forEach((ref) => { | ||
| if (ref.current) { | ||
| cancelAnimationFrame(ref.current); | ||
| } | ||
| }); | ||
| }; | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that you're having this take an array as its arg and then forEaching through to cancel each ref in the array, but then in Popper it looks like you're just wrapping the ref by itself in an array with nothing else in it each time. Am I missing/misunderstanding something here? |
||
| /** | ||
| * Helper function to get the language direction of a given element, useful for figuring out if left-to-right | ||
| * or right-to-left specific logic should be applied. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,8 @@ describe('Button Demo Test', () => { | |
| .focus() | ||
| .should('have.attr', 'aria-describedby', 'button-with-tooltip-1'); | ||
| }); | ||
| cy.get('.pf-v6-c-tooltip').should('be.visible'); | ||
| // Tooltip visibility is async due to requestAnimationFrame-based positioning | ||
| cy.get('.pf-v6-c-tooltip', { timeout: 6000 }).should('be.visible'); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have some real concerns with this change breaking a lot of tests for consumers if this change is needed. I'm not saying that's an absolute blocker, but it does give me pause. Would love to hear thoughts from others on this. |
||
| }); | ||
|
|
||
| it('Verify isAriaDisabled button has tooltip when hovered', () => { | ||
|
|
@@ -18,7 +19,7 @@ describe('Button Demo Test', () => { | |
| .trigger('mouseover') | ||
| .should('have.attr', 'aria-describedby', 'button-with-tooltip-1'); | ||
| }); | ||
| cy.get('.pf-v6-c-tooltip').should('be.visible'); | ||
| cy.get('.pf-v6-c-tooltip', { timeout: 6000 }).should('be.visible'); | ||
| }); | ||
|
|
||
| it('Verify isAriaDisabled button prevents default actions', () => { | ||
|
|
||
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.
What does
rafRefmean? The ref part I understand, but I have no idea what raf is referring to here.