@brightspace-ui/core 1.220.5 → 1.221.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,8 @@ import { tryGetIfrauBackdropService } from '../../helpers/ifrauBackdropService.j
|
|
|
14
14
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
15
15
|
const minBackdropHeightMobile = 42;
|
|
16
16
|
const minBackdropWidthMobile = 30;
|
|
17
|
+
const outerMarginTopBottom = 18;
|
|
18
|
+
const defaultVerticalOffset = 20;
|
|
17
19
|
|
|
18
20
|
export const DropdownContentMixin = superclass => class extends LocalizeCoreElement(RtlMixin(superclass)) {
|
|
19
21
|
|
|
@@ -264,6 +266,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
264
266
|
this._hasHeader = false;
|
|
265
267
|
this._hasFooter = false;
|
|
266
268
|
this._showBackdrop = false;
|
|
269
|
+
this._verticalOffset = defaultVerticalOffset;
|
|
267
270
|
|
|
268
271
|
this.__onResize = this.__onResize.bind(this);
|
|
269
272
|
this.__onAutoCloseFocus = this.__onAutoCloseFocus.bind(this);
|
|
@@ -324,9 +327,10 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
324
327
|
if (propName === 'verticalOffset') {
|
|
325
328
|
let newVerticalOffset = parseInt(this.verticalOffset);
|
|
326
329
|
if (isNaN(newVerticalOffset)) {
|
|
327
|
-
newVerticalOffset =
|
|
330
|
+
newVerticalOffset = defaultVerticalOffset;
|
|
328
331
|
}
|
|
329
332
|
this.style.setProperty('--d2l-dropdown-verticaloffset', `${newVerticalOffset}px`);
|
|
333
|
+
this._verticalOffset = newVerticalOffset;
|
|
330
334
|
}
|
|
331
335
|
});
|
|
332
336
|
}
|
|
@@ -616,9 +620,9 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
616
620
|
if (bounded) {
|
|
617
621
|
spaceAround = this._constrainSpaceAround({
|
|
618
622
|
// allow for target offset + outer margin
|
|
619
|
-
above: targetRect.top - boundingContainerRect.top -
|
|
623
|
+
above: targetRect.top - boundingContainerRect.top - this._verticalOffset - outerMarginTopBottom,
|
|
620
624
|
// allow for target offset + outer margin
|
|
621
|
-
below: boundingContainerRect.bottom - targetRect.bottom -
|
|
625
|
+
below: boundingContainerRect.bottom - targetRect.bottom - this._verticalOffset - outerMarginTopBottom,
|
|
622
626
|
// allow for outer margin
|
|
623
627
|
left: targetRect.left - boundingContainerRect.left - 20,
|
|
624
628
|
// allow for outer margin
|
|
@@ -631,9 +635,9 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
631
635
|
} else {
|
|
632
636
|
spaceAround = this._constrainSpaceAround({
|
|
633
637
|
// allow for target offset + outer margin
|
|
634
|
-
above: targetRect.top -
|
|
638
|
+
above: targetRect.top - this._verticalOffset - outerMarginTopBottom,
|
|
635
639
|
// allow for target offset + outer margin
|
|
636
|
-
below: window.innerHeight - targetRect.bottom -
|
|
640
|
+
below: window.innerHeight - targetRect.bottom - this._verticalOffset - outerMarginTopBottom,
|
|
637
641
|
// allow for outer margin
|
|
638
642
|
left: targetRect.left - 20,
|
|
639
643
|
// allow for outer margin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.221.0",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|