Bug 1801678 - Compute the right insertion point for a browser action widget when the toolbar is overflowed. r=Gijs

We have a function, OverflowableToolbar.findOverflowedInsertionPoints, whose job it is to compute
the right insertion point for a widget if the widget is being inserted into an overflowable
toolbar.

That function failed to account for the possibility that the widget was a browser action, and
would return the #defaultList instead of the #webExtList if the item was overflowing. This
patch checks the ID of the widget first, and then supplies the correct list.

Differential Revision: https://phabricator.services.mozilla.com/D162586
This commit is contained in:
Mike Conley 2022-11-24 18:51:19 +00:00
parent 62b8b0976b
commit 1dea2f808d

View File

@ -5611,9 +5611,13 @@ class OverflowableToolbar {
}
}
let overflowList = CustomizableUI.isWebExtensionWidget(aNode.id)
? this.#webExtList
: this.#defaultList;
let containerForAppending =
this.#overflowedInfo.size && newNodeCanOverflow
? this.#defaultList
? overflowList
: this.#target;
return [containerForAppending, null];
}