fit-ui 3.2.4 → 3.2.6

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.
package/dist/Fit.UI.js CHANGED
@@ -682,7 +682,7 @@ Fit._internal =
682
682
  {
683
683
  Core:
684
684
  {
685
- VersionInfo: { Major: 3, Minor: 2, Patch: 4 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
685
+ VersionInfo: { Major: 3, Minor: 2, Patch: 6 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
686
686
  }
687
687
  };
688
688
 
@@ -17771,6 +17771,10 @@ Fit.Controls.DialogEditor = function(ctlId)
17771
17771
 
17772
17772
  init();
17773
17773
  }
17774
+
17775
+
17776
+
17777
+
17774
17778
  /// <container name="Fit.Controls.DropDown" extends="Fit.Controls.ControlBase">
17775
17779
  /// Drop Down Menu control allowing for single and multi selection.
17776
17780
  /// Supports data selection using any control extending from Fit.Controls.PickerBase.
@@ -17956,8 +17960,7 @@ Fit.Controls.DropDown = function(ctlId)
17956
17960
  return; // Do not close DropDown if target no longer exists - this may happen if something is removed within DropDown (e.g. an item in the WSDropDown's action menu)
17957
17961
  }
17958
17962
 
17959
- // Notice that dropdownMenu might be rooted in <body> if it is constrained by CSS properties preventing reliable use of position:fixed - see optimizeDropDownPosition(..) for details
17960
- if (me.IsDropDownOpen() === true && target !== me.GetDomElement() && Fit.Dom.Contained(me.GetDomElement(), target) === false && target !== dropDownMenu && Fit.Dom.Contained(dropDownMenu, target) === false)
17963
+ if (me.IsDropDownOpen() === true && target !== me.GetDomElement() && Fit.Dom.Contained(me.GetDomElement(), target) === false)
17961
17964
  {
17962
17965
  me.CloseDropDown();
17963
17966
  }
@@ -17982,8 +17985,7 @@ Fit.Controls.DropDown = function(ctlId)
17982
17985
  return; // Do not close DropDown if target no longer exists - this may happen if something is removed within DropDown (e.g. an item in the WSDropDown's action menu)
17983
17986
  }
17984
17987
 
17985
- // Notice that dropdownMenu might be rooted in <body> if it is constrained by CSS properties preventing reliable use of position:fixed - see optimizeDropDownPosition(..) for details
17986
- if (me.IsDropDownOpen() === true && target !== me.GetDomElement() && Fit.Dom.Contained(me.GetDomElement(), target) === false && target !== dropDownMenu && Fit.Dom.Contained(dropDownMenu, target) === false)
17988
+ if (me.IsDropDownOpen() === true && target !== me.GetDomElement() && Fit.Dom.Contained(me.GetDomElement(), target) === false)
17987
17989
  {
17988
17990
  coords = Fit.Events.GetPointerState().Coordinates.Document;
17989
17991
  }
@@ -20251,7 +20253,17 @@ Fit.Controls.DropDown = function(ctlId)
20251
20253
  var spaceRequiredRightSide = getDropDownMaxWidthPixelValue(); // DropDownMaxWidth as px value - DropDown menu opens to the side that best accommodates the needed space - opening to the right is preferred
20252
20254
  var spacingToEdge = 10; // Makes sure that DropDown menu has this amount of spacing (in pixels) to the edge of the viewport or scroll parent
20253
20255
 
20254
- if (detectBoundariesRelToViewPort === false) // Detecting collisions against scroll parent
20256
+ // Some styles, e.g. transform:translate(..), will make position:fixed become relative
20257
+ // to the element with transform, rather than the viewport. Issue a warning in this case
20258
+ // and revert to positioning dropdown menu relative to its scroll container instead.
20259
+ var positionFixedConstrained = false;
20260
+ if (detectBoundariesRelToViewPort === true && Fit.Dom.PositionFixedConstrained(dropDownMenu) === true)
20261
+ {
20262
+ console.warn("Unable to position dropdown menu relative to viewport due to CSS constraint");
20263
+ positionFixedConstrained = true;
20264
+ }
20265
+
20266
+ if (detectBoundariesRelToViewPort === false || positionFixedConstrained === true) // Detecting collisions against scroll parent
20255
20267
  {
20256
20268
  var posFromTopWithinContainer = -1; // DropDown control's position from top within scrollable parent
20257
20269
  var posFromLeftWithinContainer = -1; // DropDown control's position from left within scrollable parent
@@ -20365,18 +20377,6 @@ Fit.Controls.DropDown = function(ctlId)
20365
20377
  // as this creates a new stacking context to which position:fixed
20366
20378
  // becomes relative.
20367
20379
 
20368
- // Move dropdown to document root if position:fixed won't work
20369
- // due to e.g. animation or transform in CSS (see note above).
20370
- if (Fit.Dom.PositionFixedConstrained(dropDownMenu) === true)
20371
- {
20372
- // Copy styles to ensure that dropdown menu assume styles identical to control itself
20373
- dropDownMenu.style.fontSize = Fit.Dom.GetComputedStyle(dropDownMenu, "font-size");
20374
- dropDownMenu.style.color = Fit.Dom.GetComputedStyle(dropDownMenu, "color");
20375
- dropDownMenu.style.fontFamily = Fit.Dom.GetComputedStyle(dropDownMenu, "font-family");
20376
-
20377
- Fit.Dom.Add(document.body, dropDownMenu); // Moved back in resetDropDownPosition() when dropdown is closed
20378
- }
20379
-
20380
20380
  var viewPortDimensions = Fit.Browser.GetViewPortDimensions(); // Returns { Width, Height } - actual space available (scrollbars are not included in these dimensions)
20381
20381
  var controlPositionY = Fit.Dom.GetBoundingPosition(itemContainer).Y; // Position from top
20382
20382
  var controlPositionX = Fit.Dom.GetBoundingPosition(itemContainer).X; // Position from left
@@ -20504,18 +20504,6 @@ Fit.Controls.DropDown = function(ctlId)
20504
20504
 
20505
20505
  function resetDropDownPosition()
20506
20506
  {
20507
- // Move dropdown menu back if it was moved to document
20508
- // root due to position:fixed being constrained by CSS
20509
- // animation, transform or similar. See optimizeDropDownPosition(..)
20510
- if (dropDownMenu.parentElement === document.body)
20511
- {
20512
- dropDownMenu.style.fontSize = "";
20513
- dropDownMenu.style.color = "";
20514
- dropDownMenu.style.fontFamily = "";
20515
-
20516
- me._internal.AddDomElement(dropDownMenu);
20517
- }
20518
-
20519
20507
  // Reset changes made by optimizeDropDownPosition()
20520
20508
  dropDownMenu.style.position = "";
20521
20509
  dropDownMenu.style.width = (maxWidth.Value > -1 ? dropDownMenu.style.width : ""); // Preserve width if DropDownMaxWidth is enabled since it also modifies this property