fit-ui 3.2.10 → 3.2.11

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: 10 } // 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: 11 } // 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
 
@@ -11908,7 +11908,16 @@ Fit.Controls.Button = function(controlId)
11908
11908
  Fit.Events.AddHandler(element, Fit.Browser.IsTouchEnabled() === true ? "touchend" : "click", function(e)
11909
11909
  {
11910
11910
  if (invokeClick === true && me.Enabled() === true)
11911
+ {
11912
+ // On computers the button would have gained focus by now, before triggering the OnClick callback,
11913
+ // but not on touch devices, where the button receives focus after the OnTouchEnd event finishes.
11914
+ // To ensure consistent behaviour across devices, we force focus the button on touch devices so that
11915
+ // external code is able to determine focused state for the button, and return focus to the button later.
11916
+ // See https://github.com/Jemt/Fit.UI/issues/214 for details.
11917
+ me.Focused(true);
11918
+
11911
11919
  me.Click();
11920
+ }
11912
11921
 
11913
11922
  if (focusedBeforeClick !== null)
11914
11923
  {
@@ -16045,6 +16054,25 @@ Fit.Controls.Dialog = function(controlId)
16045
16054
  }
16046
16055
  }
16047
16056
  });
16057
+
16058
+ if (Fit.Browser.IsTouchEnabled() === true)
16059
+ {
16060
+ // Prevent invocation of OnMouseUp, OnMouseDown, and OnClick on elements behind the dialog
16061
+ // on touch devices, if the dialog is disposed during invocation of OnTouchStart or OnTouchEnd.
16062
+ // This will also prevent a UI control from receiving focus if positioned behind the dialog.
16063
+ // See https://github.com/Jemt/Fit.UI/issues/215 for more information.
16064
+
16065
+ var stopEventIfDialogIsDisposed = function(e)
16066
+ {
16067
+ if (me === null)
16068
+ {
16069
+ Fit.Events.PreventDefault(e); // Dialog was disposed as a result of event - halt event
16070
+ }
16071
+ };
16072
+
16073
+ Fit.Events.AddHandler(me.GetDomElement(), "touchstart", stopEventIfDialogIsDisposed);
16074
+ Fit.Events.AddHandler(me.GetDomElement(), "touchend", stopEventIfDialogIsDisposed);
16075
+ }
16048
16076
  }
16049
16077
 
16050
16078
  // ============================================