perf(ot-dropdown): eliminate layout thrashing in popover positioning#125
perf(ot-dropdown): eliminate layout thrashing in popover positioning#125akilvishnum wants to merge 5 commits intoknadh:masterfrom
Conversation
|
This completely breaks dropdowns on Firefox, unfortunately. The JS positioning code is there a temporary hack to make it work on all browsers until popover anchor positioning support is widely available. |
|
Agreed. Should I proceed with that? |
|
Yep, we can try that. Please update the PR. |
|
Hi @knadh I have updated the PR with the following changes.
|
|
@knadh |
|
I tried this out, and strangely, the CSS version (this PR) shows repositioning jitter and artifacts when you scroll as opposed to JS positioning (prod). This is Firefox on Fedora. |
|
Hi @knadh Currently this PR is relying on JS for positioning. I have removed the css code for positioning, since it didn’t have support on all browsers. |
|
@akilvishnum, sorry, I'm confused now. What precisely does the PR change then? Prod is already using JS for positioning and trying out this PR, which seems to have minor changes, I can see the jitter on scroll. |
|
This PR wraps positioning logic inside requestAnimationFrame which updates the position only before the next paint and used transform instead of top and left which removes layout thrashing. |
Issue: #124
Declarative CSS APIs are used to replace layout thrashing code and reduce JS footprint.