tempusdominus / bootstrap-4

Tempus Dominus Bootstrap 4 Datetime Picker
https://getdatepicker.com/5-4/
MIT License
611 stars 239 forks source link

The keyState variable is not declared in the keydown event function #384

Open pandora-y opened 1 year ago

pandora-y commented 1 year ago

_proto._keydown = function _keydown(e) { var handler = null, index, index2, keyBindKeys, allModifiersPressed; var pressedKeys = [], pressedModifiers = {}, currentKey = e.which, pressed = 'p'; keyState[currentKey] = pressed;

  for (index in keyState) {
    if (keyState.hasOwnProperty(index) && keyState[index] === pressed) {
      pressedKeys.push(index);

      if (parseInt(index, 10) !== currentKey) {
        pressedModifiers[index] = true;
      }
    }
  }

keyState should be declared.

pandora-y commented 1 year ago

keyState should be declared in _keydown function.