Skip to content

Commit

Permalink
fix(components): [input] missing autofocus types (#14246)
Browse files Browse the repository at this point in the history
* fix(components): [input] missing autofocus types

closed #14243

* fix: autofocus default to false
  • Loading branch information
HeftyKoo committed Sep 14, 2023
1 parent 6e24736 commit 09bb91a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/components/input/src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ export const inputProps = buildProps({
type: definePropType<StyleValue>([Object, Array, String]),
default: () => mutable({} as const),
},
/**
* @description native input autofocus
*/
autofocus: {
type: Boolean,
default: false,
},
} as const)
export type InputProps = ExtractPropTypes<typeof inputProps>

Expand Down
2 changes: 2 additions & 0 deletions packages/components/input/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
:placeholder="placeholder"
:style="inputStyle"
:form="props.form"
:autofocus="props.autofocus"
@compositionstart="handleCompositionStart"
@compositionupdate="handleCompositionUpdate"
@compositionend="handleCompositionEnd"
Expand Down Expand Up @@ -118,6 +119,7 @@
:aria-label="label"
:placeholder="placeholder"
:form="props.form"
:autofocus="props.autofocus"
@compositionstart="handleCompositionStart"
@compositionupdate="handleCompositionUpdate"
@compositionend="handleCompositionEnd"
Expand Down

0 comments on commit 09bb91a

Please sign in to comment.