Skip to content

Commit b96a1cc

Browse files
committed
feat(InputTags): add max-length prop
Resolves #4405
1 parent 4ce6540 commit b96a1cc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎docs/content/3.components/input-tags.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ props:
5151
---
5252
::
5353

54+
### Max Length :badge{label="Soon" class="align-text-top"}
55+
56+
Use the `max-length` prop to set the maximum number of characters allowed in a tag.
57+
58+
::component-code
59+
---
60+
props:
61+
maxLength: 4
62+
---
63+
::
64+
5465
### Color
5566

5667
Use the `color` prop to change the ring color when the InputTags is focused.

‎src/runtime/components/InputTags.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export interface InputTagsProps<T extends InputTagItem = InputTagItem> extends P
1818
as?: any
1919
/** The placeholder text when the input is empty. */
2020
placeholder?: string
21+
/** The maximum number of character allowed. */
22+
maxLength?: number
2123
/**
2224
* @defaultValue 'primary'
2325
*/
@@ -182,6 +184,7 @@ defineExpose({
182184
ref="inputRef"
183185
v-bind="{ ...$attrs, ...ariaAttrs }"
184186
:placeholder="placeholder"
187+
:max-length="maxLength"
185188
:class="ui.input({ class: props.ui?.input })"
186189
/>
187190

0 commit comments

Comments
 (0)