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);
|
let fromRects = this._getRects(animatingElements);
|
||||||
|
|
||||||
// We need to wait for rAF for lit to re-render, and us to get the final
|
// We need to wait for lit to re-render, and us to get the final width.
|
||||||
// width. This is a bit unfortunate but alas...
|
// This is a bit unfortunate but alas...
|
||||||
let toRects = await new Promise(resolve => {
|
this.sidebarMain.requestUpdate();
|
||||||
requestAnimationFrame(() => {
|
await this.sidebarMain.updateComplete;
|
||||||
resolve(this._getRects(animatingElements));
|
let toRects = this._getRects(animatingElements);
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
duration: document.documentElement.hasAttribute("sidebar-expand-on-hover")
|
duration: document.documentElement.hasAttribute("sidebar-expand-on-hover")
|
||||||
|
|||||||
Reference in New Issue
Block a user