Skip to content

Commit 8237b64

Browse files
author
Joren Broekema
committed
fix(overlays): remove setting inheritsReferenceWidth by default
1 parent 5271f05 commit 8237b64

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

packages/overlays/src/OverlayController.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class OverlayController {
2626
invokerNode: config.invokerNode,
2727
referenceNode: null,
2828
elementToFocusAfterHide: document.body,
29-
inheritsReferenceWidth: 'min',
29+
inheritsReferenceWidth: '',
3030
hasBackdrop: false,
3131
isBlocking: false,
3232
preventsScroll: false,
@@ -498,8 +498,10 @@ export class OverlayController {
498498
case 'full':
499499
this._contentNodeWrapper.style.width = referenceWidth;
500500
break;
501-
default:
501+
case 'min':
502502
this._contentNodeWrapper.style.minWidth = referenceWidth;
503+
break;
504+
/* no default */
503505
}
504506
}
505507

packages/overlays/test/local-positioning.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ describe('Local Positioning', () => {
202202
`);
203203
await ctrl.show();
204204
expect(normalizeTransformStyle(ctrl.content.style.transform)).to.equal(
205-
'translate3d(0px, -28px, 0px)',
205+
'translate3d(10px, -28px, 0px)',
206206
'Popper positioning values',
207207
);
208208

209209
await ctrl.hide();
210210
await ctrl.show();
211211
expect(normalizeTransformStyle(ctrl.content.style.transform)).to.equal(
212-
'translate3d(0px, -28px, 0px)',
212+
'translate3d(10px, -28px, 0px)',
213213
'Popper positioning values should be identical after hiding and showing',
214214
);
215215
});
@@ -242,7 +242,7 @@ describe('Local Positioning', () => {
242242

243243
await ctrl.show();
244244
expect(normalizeTransformStyle(ctrl.content.style.transform)).to.equal(
245-
'translate3d(0px, -30px, 0px)',
245+
'translate3d(10px, -30px, 0px)',
246246
'Popper positioning values',
247247
);
248248

@@ -258,7 +258,7 @@ describe('Local Positioning', () => {
258258
await ctrl.show();
259259
expect(ctrl._popper.options.modifiers.offset.offset).to.equal('0, 20px');
260260
expect(normalizeTransformStyle(ctrl.content.style.transform)).to.equal(
261-
'translate3d(0px, -40px, 0px)',
261+
'translate3d(10px, -40px, 0px)',
262262
'Popper positioning Y value should be 10 less than previous, due to the added extra 10px offset',
263263
);
264264
});
@@ -292,7 +292,7 @@ describe('Local Positioning', () => {
292292

293293
await ctrl.show();
294294
expect(normalizeTransformStyle(ctrl.content.style.transform)).to.equal(
295-
'translate3d(0px, -30px, 0px)',
295+
'translate3d(10px, -30px, 0px)',
296296
'Popper positioning values',
297297
);
298298

@@ -305,7 +305,7 @@ describe('Local Positioning', () => {
305305
},
306306
});
307307
expect(normalizeTransformStyle(ctrl.content.style.transform)).to.equal(
308-
'translate3d(0px, -40px, 0px)',
308+
'translate3d(10px, -40px, 0px)',
309309
'Popper positioning Y value should be 10 less than previous, due to the added extra 10px offset',
310310
);
311311
});

0 commit comments

Comments
 (0)