@wernfried/daterangepicker 5.3.0 → 5.3.1

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.
@@ -538,16 +538,16 @@ class DateRangePicker {
538
538
  this.addListener(".ranges", "mouseleave", "li", this.leaveRange.bind(this));
539
539
  this.addListener(".drp-buttons", "click", "button.applyBtn", this.clickApply.bind(this));
540
540
  this.addListener(".drp-buttons", "click", "button.cancelBtn", this.clickCancel.bind(this));
541
- if (this.showOnClick) {
542
- if (this.element.matches("input") || this.element.matches("button")) {
541
+ if (this.element.matches("input") || this.element.matches("button")) {
542
+ if (this.showOnClick) {
543
543
  this.element.addEventListener("click", this.#showProxy);
544
544
  this.element.addEventListener("focus", this.#showProxy);
545
- this.element.addEventListener("keyup", this.#elementChangedProxy);
546
- this.element.addEventListener("keydown", this.#keydownProxy);
547
- } else {
548
- this.element.addEventListener("click", this.#toggleProxy);
549
- this.element.addEventListener("keydown", this.#toggleProxy);
550
545
  }
546
+ this.element.addEventListener("keyup", this.#elementChangedProxy);
547
+ this.element.addEventListener("keydown", this.#keydownProxy);
548
+ } else if (this.showOnClick) {
549
+ this.element.addEventListener("click", this.#toggleProxy);
550
+ this.element.addEventListener("keydown", this.#toggleProxy);
551
551
  }
552
552
  if (this.button)
553
553
  this.button.addEventListener("click", this.#showProxy);