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(useFormGroup): app config default input size #2011

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

romhml
Copy link
Collaborator

@romhml romhml commented Aug 2, 2024

πŸ”— Linked issue

Resolves #1990

❓ Type of change

Fixes an issue with the default size configuration of inputs when not used with a FormField introduced in this PR: https://github.com/nuxt/ui/pull/1875.

In short, we were always using the FormGroup's default size instead of prioritising the input's default size configuration.

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@@ -62,7 +63,8 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => {
name: computed(() => inputProps?.name ?? formGroup?.name.value),
size: computed(() => {
const formGroupSize = config.size[formGroup?.size.value as string] ? formGroup?.size.value : null
return inputProps?.size ?? formGroupSize ?? formGroupConfig?.default?.size
const defaultSize = config.default?.size ?? formGroupConfig?.default?.size
Copy link
Member

Choose a reason for hiding this comment

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

I guess ?? formGroupConfig?.default?.size is not necessary as config.default?.size will always be defined.

@benjamincanac benjamincanac changed the title fix(useFormGroup): app.config.ts default input size fix(useFormGroup): app config default input size Aug 2, 2024
@benjamincanac benjamincanac merged commit 3485092 into dev Aug 2, 2024
2 checks passed
@benjamincanac benjamincanac deleted the fix/input-default-size branch August 2, 2024 16:03
davestewart added a commit to davestewart/nuxt-ui that referenced this pull request Aug 2, 2024
* dev:
  fix(module): reduce css bundle size by fixing safelist regex (nuxt#2005)
  fix(useFormGroup): app config default input size (nuxt#2011)
binhtranhuu pushed a commit to binhtranhuu/nuxt-ui that referenced this pull request Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customization of input size in app.config.ts is not working
2 participants