fix(overlays): get the precise referenceNode width

This commit is contained in:
qa46hx 2020-12-07 16:14:35 +01:00
parent 0fbdf5a8bf
commit c61be3a844

View file

@ -1098,8 +1098,7 @@ export class OverlayController extends EventTargetShim {
if (!this._referenceNode || this.placementMode === 'global') {
return;
}
const referenceWidth = `${this._referenceNode.clientWidth}px`;
const referenceWidth = `${this._referenceNode.getBoundingClientRect().width}px`;
switch (this.inheritsReferenceWidth) {
case 'max':
this.contentWrapperNode.style.maxWidth = referenceWidth;