Bug 1960926 - More explicitly wait for sidebar update. r=sidebar-reviewers,kcochrane
This is the front-end side fix. We might want to change the rendering code too, I'm still investigating if this is web observable. Differential Revision: https://phabricator.services.mozilla.com/D246131
This commit is contained in:
@@ -1081,13 +1081,11 @@ var SidebarController = {
|
||||
|
||||
let fromRects = this._getRects(animatingElements);
|
||||
|
||||
// We need to wait for rAF for lit to re-render, and us to get the final
|
||||
// width. This is a bit unfortunate but alas...
|
||||
let toRects = await new Promise(resolve => {
|
||||
requestAnimationFrame(() => {
|
||||
resolve(this._getRects(animatingElements));
|
||||
});
|
||||
});
|
||||
// We need to wait for lit to re-render, and us to get the final width.
|
||||
// This is a bit unfortunate but alas...
|
||||
this.sidebarMain.requestUpdate();
|
||||
await this.sidebarMain.updateComplete;
|
||||
let toRects = this._getRects(animatingElements);
|
||||
|
||||
const options = {
|
||||
duration: document.documentElement.hasAttribute("sidebar-expand-on-hover")
|
||||
|
||||
Reference in New Issue
Block a user