fit-ui 3.2.11 → 3.2.12

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: 11 } // 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: 12 } // 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
 
@@ -14068,11 +14068,21 @@ Fit.Controls.DatePicker = function(ctlId)
14068
14068
  input.placeholder = getDatePlaceholder();
14069
14069
  input.tabIndex = ((isMobile === true) ? -1 : 0);
14070
14070
 
14071
- // Prevent jQuery UI from focusing input field when calendar is opened (brings up virtual keyboard on touch devices).
14071
+ // Prevent jQuery UI from focusing input field on touch devices when calendar is opened or when changing year/month (brings up virtual keyboard).
14072
14072
  // https://github.com/Jemt/Fit.UI/blob/5e8f2183d75ae17ddb8086ebbe39025a7a7c98bb/Resources/JqueryUI-1.11.4.custom/jquery-ui.js#L1090
14073
14073
  // => https://github.com/Jemt/Fit.UI/blob/5e8f2183d75ae17ddb8086ebbe39025a7a7c98bb/Resources/JqueryUI-1.11.4.custom/external/jquery/jquery.js#L5268
14074
14074
  input._focus = input.focus;
14075
- input.focus = function() { console.debug("focus() disabled for this input field"); };
14075
+ input.focus = function()
14076
+ {
14077
+ if (Fit.Device.OptimizeForTouch === true && me.TriggerIcon() === true)
14078
+ {
14079
+ icon.focus();
14080
+ }
14081
+ else
14082
+ {
14083
+ input._focus();
14084
+ }
14085
+ };
14076
14086
 
14077
14087
  input.onkeydown = function(e)
14078
14088
  {
@@ -14251,12 +14261,13 @@ Fit.Controls.DatePicker = function(ctlId)
14251
14261
 
14252
14262
  icon = document.createElement("span");
14253
14263
  icon.className = "fa fa-calendar";
14264
+ icon.style.outline = "none"; // Avoid outline when focused
14254
14265
  icon.tabIndex = -1;
14255
14266
  icon.onclick = function(e)
14256
14267
  {
14257
14268
  me.Show();
14258
14269
 
14259
- if (me.TriggerIcon() === false) // Focus input if icon is hidden
14270
+ if (me.TriggerIcon() === false) // Focus input if icon is hidden (using opacity:0)
14260
14271
  {
14261
14272
  input._focus();
14262
14273
  }
@@ -14339,7 +14350,7 @@ Fit.Controls.DatePicker = function(ctlId)
14339
14350
  }
14340
14351
  }
14341
14352
 
14342
- var hasFocus = Fit.Array.Contains([input, inputTime, inputMobile, inputTimeMobile], Fit.Dom.GetFocused()) === true;
14353
+ var hasFocus = Fit.Array.Contains([icon, input, inputTime, inputMobile, inputTimeMobile], Fit.Dom.GetFocused()) === true;
14343
14354
 
14344
14355
  if (hasFocus === false && isMobile === false)
14345
14356
  {
@@ -15296,16 +15307,18 @@ Fit.Controls.DatePicker = function(ctlId)
15296
15307
  {
15297
15308
  // Retain focus when changing month or year using calendar
15298
15309
  // widget, which causes its DOM to be removed and replaced.
15299
- // Focus is later returned to DatePicker, but not in time for
15310
+ // Focus is later returned to input field, but not in time for
15300
15311
  // OnFocusOut. Related issue: https://github.com/Jemt/Fit.UI/issues/194
15301
- if (Fit.Device.OptimizeForTouch === true && me.TriggerIcon() === true)
15312
+ // DISABLED: Logic moved to input.focus override.
15313
+ /*if (Fit.Device.OptimizeForTouch === true && me.TriggerIcon() === true)
15302
15314
  {
15303
15315
  icon.focus(); // Focusing icon to prevent virtual keyboard from being shown on touch devices
15304
15316
  }
15305
15317
  else
15306
15318
  {
15307
15319
  input._focus(); // Do not use Focused(true) as it will not re-focus input, since control is already considered focused
15308
- }
15320
+ }*/
15321
+ input.focus();
15309
15322
 
15310
15323
  if (open === true) // Remember which year and month the user navigated to
15311
15324
  {
@@ -15323,14 +15336,16 @@ Fit.Controls.DatePicker = function(ctlId)
15323
15336
  {
15324
15337
  startDate = null;
15325
15338
 
15326
- if (Fit.Device.OptimizeForTouch === true && me.TriggerIcon() === true)
15339
+ // DISABLED: Logic moved to input.focus override
15340
+ /*if (Fit.Device.OptimizeForTouch === true && me.TriggerIcon() === true)
15327
15341
  {
15328
15342
  icon.focus(); // Focusing icon to prevent virtual keyboard from being shown on touch devices
15329
15343
  }
15330
15344
  else
15331
15345
  {
15332
15346
  input._focus(); // Do not use Focused(true) as it will not re-focus input, since control is already considered focused
15333
- }
15347
+ }*/
15348
+ input.focus();
15334
15349
 
15335
15350
  input.onchange();
15336
15351
  },