@@ -11,6 +11,7 @@ import {
11
11
Watch ,
12
12
h ,
13
13
} from '@stencil/core' ;
14
+ import { ENTER } from 'key-definitions' ;
14
15
import type { AutoCapitalize , EnterKeyHint , FormAssociatedInterface , KeyboardType , Size } from 'src/interface' ;
15
16
import { componentConfig , config } from '#config' ;
16
17
import { type Attributes , hostContext , inheritAriaAttributes , inheritAttributes } from '#utils/helpers' ;
@@ -404,6 +405,12 @@ export class Input implements ComponentInterface, FormAssociatedInterface {
404
405
} , this . debounce || 0 ) ;
405
406
} ;
406
407
408
+ private onKeyUp = ( ev : KeyboardEvent ) : void => {
409
+ if ( ev . key === ENTER . key ) {
410
+ this . internals . form ?. requestSubmit ( ) ;
411
+ }
412
+ } ;
413
+
407
414
private onCompositionStart = ( ) => {
408
415
this . isComposing = true ;
409
416
} ;
@@ -456,17 +463,17 @@ export class Input implements ComponentInterface, FormAssociatedInterface {
456
463
>
457
464
< slot name = "start" />
458
465
< input
459
- autoCapitalize = { this . autoCapitalize }
460
- autoComplete = { this . autoComplete }
461
- autoFocus = { this . autoFocus }
466
+ autocapitalize = { this . autoCapitalize }
467
+ autocomplete = { this . autoComplete }
468
+ autofocus = { this . autoFocus }
462
469
disabled = { this . disabled }
463
- enterKeyHint = { this . enterkeyhint }
470
+ enterkeyhint = { this . enterkeyhint }
464
471
id = { inputId }
465
- inputMode = { this . keyboard }
472
+ inputmode = { this . keyboard }
466
473
max = { this . max }
467
- maxLength = { this . maxLength }
474
+ maxlength = { this . maxLength }
468
475
min = { this . min }
469
- minLength = { this . minLength }
476
+ minlength = { this . minLength }
470
477
multiple = { this . multiple }
471
478
name = { this . name }
472
479
onBlur = { this . onBlur }
@@ -475,6 +482,7 @@ export class Input implements ComponentInterface, FormAssociatedInterface {
475
482
onCompositionstart = { this . onCompositionStart }
476
483
onFocus = { this . onFocus }
477
484
onInput = { this . onInput }
485
+ onKeyUp = { this . onKeyUp }
478
486
part = { `native ${ this . type } ` }
479
487
pattern = { this . pattern }
480
488
placeholder = { this . placeholder || '' }
0 commit comments