fit-ui 3.2.5 → 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: 5 } // 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
  }
@@ -18371,10 +18373,6 @@ Fit.Controls.DropDown = function(ctlId)
18371
18373
  {
18372
18374
  // This will destroy control - it will no longer work!
18373
18375
 
18374
- // Make sure globally mounted dropdown menu is returned to control's container in case
18375
- // control is disposed while open - otherwise it will not be removed from the document.
18376
- resetDropDownPosition();
18377
-
18378
18376
  if (picker !== null)
18379
18377
  picker.Destroy();
18380
18378
 
@@ -20255,7 +20253,17 @@ Fit.Controls.DropDown = function(ctlId)
20255
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
20256
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
20257
20255
 
20258
- 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
20259
20267
  {
20260
20268
  var posFromTopWithinContainer = -1; // DropDown control's position from top within scrollable parent
20261
20269
  var posFromLeftWithinContainer = -1; // DropDown control's position from left within scrollable parent
@@ -20369,18 +20377,6 @@ Fit.Controls.DropDown = function(ctlId)
20369
20377
  // as this creates a new stacking context to which position:fixed
20370
20378
  // becomes relative.
20371
20379
 
20372
- // Move dropdown to document root if position:fixed won't work
20373
- // due to e.g. animation or transform in CSS (see note above).
20374
- if (Fit.Dom.PositionFixedConstrained(dropDownMenu) === true)
20375
- {
20376
- // Copy styles to ensure that dropdown menu assume styles identical to control itself
20377
- dropDownMenu.style.fontSize = Fit.Dom.GetComputedStyle(dropDownMenu, "font-size");
20378
- dropDownMenu.style.color = Fit.Dom.GetComputedStyle(dropDownMenu, "color");
20379
- dropDownMenu.style.fontFamily = Fit.Dom.GetComputedStyle(dropDownMenu, "font-family");
20380
-
20381
- Fit.Dom.Add(document.body, dropDownMenu); // Moved back in resetDropDownPosition() when dropdown is closed
20382
- }
20383
-
20384
20380
  var viewPortDimensions = Fit.Browser.GetViewPortDimensions(); // Returns { Width, Height } - actual space available (scrollbars are not included in these dimensions)
20385
20381
  var controlPositionY = Fit.Dom.GetBoundingPosition(itemContainer).Y; // Position from top
20386
20382
  var controlPositionX = Fit.Dom.GetBoundingPosition(itemContainer).X; // Position from left
@@ -20508,18 +20504,6 @@ Fit.Controls.DropDown = function(ctlId)
20508
20504
 
20509
20505
  function resetDropDownPosition()
20510
20506
  {
20511
- // Move dropdown menu back if it was moved to document
20512
- // root due to position:fixed being constrained by CSS
20513
- // animation, transform or similar. See optimizeDropDownPosition(..)
20514
- if (dropDownMenu.parentElement === document.body)
20515
- {
20516
- dropDownMenu.style.fontSize = "";
20517
- dropDownMenu.style.color = "";
20518
- dropDownMenu.style.fontFamily = "";
20519
-
20520
- me._internal.AddDomElement(dropDownMenu);
20521
- }
20522
-
20523
20507
  // Reset changes made by optimizeDropDownPosition()
20524
20508
  dropDownMenu.style.position = "";
20525
20509
  dropDownMenu.style.width = (maxWidth.Value > -1 ? dropDownMenu.style.width : ""); // Preserve width if DropDownMaxWidth is enabled since it also modifies this property