-
Notifications
You must be signed in to change notification settings - Fork 205
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(overlay): returning only the first element for slot assignedElements #4930
base: main
Are you sure you want to change the base?
Conversation
We would like to see you use case here considering this is very specific. Can you add a video or a repro to show how does this solve your issue? |
@Rajdeepc Yes, I can add a video or we can do another debug session so I can walk threw it with you or you team? |
@Rajdeepc This is a video of the component not rendering. The component container stays blank and you can see the console output going forever. It will eventually crash the browser. Sequence.low.02.mp4 |
This seems to be a condition where the entire component is re-rendering multiple times due to state or property changes. Can you do a repro of your use case by any means? |
|
@Rajdeepc Express does use Service Workers but its still very resource heavy and I think its effecting the rendering of our component. We also use a lot of OverlayTriggers that might effect render changes also. |
Only return first element form
assignedElements
instead of an array of elements.Description
This PR reverses a helper method that was used in the previous version of the
OverLayTrigger
. In that version, theslotchange
handler usesassignedNodes
instead ofassignedElements
. I think usingassignedElements
renders the slot so fast, that our dialog component has not completed loading, leading to forcing a reload, in which it does goes threw the same process.spectrum-web-components/packages/overlay/src/OverlayTrigger.ts
Line 454 in a532ff8
Related issue(s)
[Bug]: OverlayTrigger can get stuck in a render loop causing page to crash
Motivation and context
Resolves an issue related to endless render loop.
How has this been tested?
Screenshots (if appropriate)
N/A
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.