feat(InputTags): add max-length prop

Resolves #4405
This commit is contained in:
Benjamin Canac
2025-07-01 10:34:46 +02:00
parent 4ce654076c
commit b96a1ccbab
2 changed files with 14 additions and 0 deletions

View File

@@ -51,6 +51,17 @@ props:
---
::
### Max Length :badge{label="Soon" class="align-text-top"}
Use the `max-length` prop to set the maximum number of characters allowed in a tag.
::component-code
---
props:
maxLength: 4
---
::
### Color
Use the `color` prop to change the ring color when the InputTags is focused.

View File

@@ -18,6 +18,8 @@ export interface InputTagsProps<T extends InputTagItem = InputTagItem> extends P
as?: any
/** The placeholder text when the input is empty. */
placeholder?: string
/** The maximum number of character allowed. */
maxLength?: number
/**
* @defaultValue 'primary'
*/
@@ -182,6 +184,7 @@ defineExpose({
ref="inputRef"
v-bind="{ ...$attrs, ...ariaAttrs }"
:placeholder="placeholder"
:max-length="maxLength"
:class="ui.input({ class: props.ui?.input })"
/>