Skip to content
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

Fix: vaInput component max Length issue(#4052) #4110

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<slot name="loading">
<va-icon
class="va-inner-loading__spinner"
spin
spin="counter-clockwise"
:color="colorComputed"
:size="$props.size"
:name="$props.icon"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-input/VaInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default defineComponent({

const computedInputAttributes = computed(() => ({
...computedChildAttributes.value,
...pick(props, ['type', 'disabled', 'readonly', 'placeholder', 'pattern', 'inputmode', 'minlength', 'maxlength']),
...pick(props, ['type', 'disabled', 'readonly', 'placeholder', 'pattern', 'inputmode', 'minlength', 'maxLength']),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for minLength I think.

Suggested change
...pick(props, ['type', 'disabled', 'readonly', 'placeholder', 'pattern', 'inputmode', 'minlength', 'maxLength']),
...pick(props, ['type', 'disabled', 'readonly', 'placeholder', 'pattern', 'inputmode', 'minLength', 'maxLength']),

Also, would be nice to handle maxlength and minlength for attrs (similar to native input, but it is nice to have, not required)

}) as InputHTMLAttributes)

const valueLengthComputed = computed(() =>
Expand Down