@skyux/core 12.0.0-alpha.7 → 12.0.0-alpha.8

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.
@@ -322,6 +322,9 @@ function getInversePlacement(placement) {
322
322
  return pairings[placement];
323
323
  }
324
324
 
325
+ function useViewportForBounds(element) {
326
+ return 'BODY' === element.tagName;
327
+ }
325
328
  /**
326
329
  * Returns the offset values of a given element.
327
330
  * @param element The HTML element.
@@ -418,7 +421,7 @@ function getOverflowParents(child) {
418
421
  */
419
422
  function isOffsetFullyVisibleWithinParent(viewportRuler, parent, offset, bufferOffset) {
420
423
  let parentOffset;
421
- if (parent.matches('body')) {
424
+ if (useViewportForBounds(parent)) {
422
425
  const viewportRect = viewportRuler.getViewportRect();
423
426
  parentOffset = {
424
427
  top: 0,
@@ -439,9 +442,22 @@ function isOffsetFullyVisibleWithinParent(viewportRuler, parent, offset, bufferO
439
442
  parentOffset.left <= offset.left);
440
443
  }
441
444
  function isOffsetPartiallyVisibleWithinParent(viewportRuler, parent, offset, bufferOffset) {
442
- const parentOffset = bufferOffset
443
- ? getElementOffset(parent, bufferOffset)
444
- : getVisibleRectForElement(viewportRuler, parent);
445
+ let parentOffset;
446
+ if (useViewportForBounds(parent)) {
447
+ const viewportRect = viewportRuler.getViewportRect();
448
+ parentOffset = {
449
+ top: 0,
450
+ left: 0,
451
+ right: viewportRect.width,
452
+ bottom: viewportRect.height,
453
+ };
454
+ }
455
+ else if (bufferOffset) {
456
+ parentOffset = getElementOffset(parent, bufferOffset);
457
+ }
458
+ else {
459
+ parentOffset = getVisibleRectForElement(viewportRuler, parent);
460
+ }
445
461
  return !(parentOffset.top >= offset.bottom ||
446
462
  parentOffset.right <= offset.left ||
447
463
  parentOffset.bottom <= offset.top ||
@@ -4602,7 +4618,7 @@ class Version {
4602
4618
  /**
4603
4619
  * Represents the version of @skyux/core.
4604
4620
  */
4605
- const VERSION = new Version('12.0.0-alpha.7');
4621
+ const VERSION = new Version('12.0.0-alpha.8');
4606
4622
 
4607
4623
  /**
4608
4624
  * Generated bundle index. Do not edit.