fit-ui 3.2.8 → 3.2.9

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: 8 } // 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: 9 } // 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
 
@@ -19820,6 +19820,15 @@ Fit.Controls.DropDown = function(ctlId)
19820
19820
  }
19821
19821
  }
19822
19822
 
19823
+ var isIgnoreKey = function(keyCode, allowDelete)
19824
+ {
19825
+ // 8 = Backspace, 9 = Tab, 13 = Enter, 16 = Shift, 20 = Caps lock, 27 = Escape, 37-40 = Arrow keys, 46 = Delete
19826
+
19827
+ var modKeys = Fit.Events.GetModifierKeys();
19828
+ return modKeys.Ctrl === true || modKeys.Alt === true || modKeys.Meta === true || // Ignore all keystrokes combined with modifiers
19829
+ Fit.Array.Contains([9, 13, 16, 20, 27, 37, 38, 39, 40], keyCode) === true || (allowDelete !== true && (keyCode === 8 || keyCode === 46));
19830
+ };
19831
+
19823
19832
  txt.onkeydown = function(e) // Fires continuously for any key pressed - both characters and e.g backspace/delete/arrows etc. Key press may be canceled (change has not yet occured)
19824
19833
  {
19825
19834
  var ev = Fit.Events.GetEvent(e);
@@ -19827,6 +19836,12 @@ Fit.Controls.DropDown = function(ctlId)
19827
19836
  txtActive = txt;
19828
19837
  clearAllInputsButActive();
19829
19838
 
19839
+ if (isIgnoreKey(ev.keyCode) === false)
19840
+ {
19841
+ updatePlaceholder(true, true); // Make sure placeholder is removed immediately on keystroke
19842
+ setInputEditing(txt, true);
19843
+ }
19844
+
19830
19845
  if (picker !== null)
19831
19846
  {
19832
19847
  if (me.IsDropDownOpen() === true)
@@ -19844,8 +19859,7 @@ Fit.Controls.DropDown = function(ctlId)
19844
19859
 
19845
19860
  // Skip if key press is TAB, ENTER, ESC, LEFT, UP, RIGHT, or DOWN.
19846
19861
  // Also ignore key press if combined with modifier keys (except if SHIFT+Key for upper case letters, of course).
19847
- var modKeys = Fit.Events.GetModifierKeys();
19848
- if (Fit.Array.Contains([9, 13, 27, 37, 38, 39, 40], ev.keyCode) === false && (modKeys.Shift === false || modKeys.KeyDown !== 16) && modKeys.Ctrl === false && modKeys.Alt === false && modKeys.Meta === false)
19862
+ if (isIgnoreKey(ev.keyCode, true) === false)
19849
19863
  {
19850
19864
  // User is entering a value - clear input before character is applied to input
19851
19865
 
@@ -20017,12 +20031,12 @@ Fit.Controls.DropDown = function(ctlId)
20017
20031
  }
20018
20032
  }
20019
20033
 
20020
- txt.onkeypress = function(e) // Fires continuously for real character keys (unless suppressed in OnKeyDown)
20034
+ // DISABLED - no longer supported on Chromium on Android - code moved to OnKeyDown handler above
20035
+ /*txt.onkeypress = function(e) // Fires continuously for real character keys (unless suppressed in OnKeyDown)
20021
20036
  {
20022
20037
  updatePlaceholder(true, true); // Make sure placeholder is removed immediately on keystroke
20023
-
20024
20038
  setInputEditing(txt, true);
20025
- }
20039
+ }*/
20026
20040
 
20027
20041
  txt.onkeyup = function(e) // Fires only once when a key is released (unless suppressed in OnKeyDown)
20028
20042
  {