Skip to content

Commit

Permalink
fix(cc-input-date): fix Enter keystroke when not into a form element
Browse files Browse the repository at this point in the history
  • Loading branch information
pdesoyres-cc committed Jun 28, 2024
1 parent 2d13b93 commit 31bcb3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/cc-input-date/cc-input-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,12 @@ export class CcInputDate extends CcFormControlElement {
// Here we prevent keydown on enter key from modifying the value
if (e.type === 'keydown' && e.key === 'Enter') {
e.preventDefault();
this._internals.form.requestSubmit();
this._internals.form?.requestSubmit();
dispatchCustomEvent(this, 'requestimplicitsubmit');
}
// Request implicit submit with keypress on enter key
if (!this.readonly && e.type === 'keypress' && e.key === 'Enter') {
this._internals.form.requestSubmit();
this._internals.form?.requestSubmit();
dispatchCustomEvent(this, 'requestimplicitsubmit');
}

Expand Down

0 comments on commit 31bcb3c

Please sign in to comment.