-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(PinInput): add delimiter option #6392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,11 @@ export interface PinInputProps<T extends PinInputType = 'text'> extends Pick<Pin | |
| highlight?: boolean | ||
| /** Keep the mobile text size on all breakpoints. */ | ||
| fixed?: boolean | ||
| /** | ||
| * Position(s) after which to insert a delimiter. | ||
| * @example [3, 6] // Insert delimiters after 3rd and 6th inputs | ||
| */ | ||
| delimiterPositions?: number[] | ||
|
Comment on lines
+42
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider paste/autofill sanitization to fully address issue The linked issue calls out robust paste/autofill handling β e.g., pasting
If that's intentionally out of scope for this PR, consider calling it out as a known limitation in the docs; otherwise, an π€ Prompt for AI Agents |
||
| class?: any | ||
| ui?: PinInput['slots'] | ||
| } | ||
|
|
@@ -134,16 +139,21 @@ defineExpose({ | |
| @update:model-value="emitFormInput()" | ||
| @complete="onComplete" | ||
| > | ||
| <PinInputInput | ||
| v-for="(ids, index) in looseToNumber(props.length)" | ||
| :key="ids" | ||
| :ref="el => setInputRef(index as number, el)" | ||
| :index="(index as number)" | ||
| data-slot="base" | ||
| :class="ui.base({ class: uiProp?.base })" | ||
| :disabled="disabled" | ||
| @blur="onBlur" | ||
| @focus="emitFormFocus" | ||
| /> | ||
| <template v-for="(ids, index) in looseToNumber(props.length)" :key="ids"> | ||
| <PinInputInput | ||
| :ref="el => setInputRef(index as number, el)" | ||
| :index="(index as number)" | ||
| data-slot="base" | ||
| :class="ui.base({ class: uiProp?.base })" | ||
| :disabled="disabled" | ||
| @blur="onBlur" | ||
| @focus="emitFormFocus" | ||
| /> | ||
| <span v-if="delimiterPositions?.includes((index as number) + 1)" data-slot="delimiter" aria-hidden="true"> | ||
| <slot name="delimiter"> | ||
| <span class="text-dimmed">β’</span> | ||
| </slot> | ||
| </span> | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| </template> | ||
| </PinInputRoot> | ||
| </template> | ||
Uh oh!
There was an error while loading. Please reload this page.