fix(components): resolve form field props and cancel pending search term reset - #6834
fix(components): resolve form field props and cancel pending search term reset#6834benjamincanac wants to merge 2 commits into
Conversation
…erm reset FileUpload resolves `size` and `disabled` through `useFormField` and forwards the resolved size to its avatars and delete button. CheckboxGroup forwards the resolved color and size to its items so theme defaults reach them. SelectMenu and InputMenu hoist `timeoutId` out of `onUpdateOpen` so the `clearTimeout` on reopen is no longer a no-op.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe update applies resolved form-field values to checkbox and file-upload controls. It standardizes direct access to computed size values across input components. It also retains timeout identifiers in Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/runtime/components/CheckboxGroup.vueParsing error: Unexpected token ) src/runtime/components/FileUpload.vueParsing error: Unexpected token ) src/runtime/components/Input.vueParsing error: Unexpected token )
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
🔗 Linked issue
❓ Type of change
📚 Description
A few small fixes around how form controls resolve their props.
FileUpload read
props.sizeandprops.disableddirectly instead of going throughuseFormField, so a wrapping<UFormField size="xl">or<UForm disabled>didn't reach it. Both now resolve through the composable, and the resolved size is forwarded to the file avatars and the delete button, which still read the raw prop and would otherwise stay atmdwhile the dropzone scaled.disableduses||rather than??on the theme fallback on purpose.disabledis a Boolean prop with nowithDefaultsentry, so Vue casts it tofalsewhen unset and a??fallback can never fire, which would have dropped theapp.config/<UTheme :props>path the previousprops.disabledhad.CheckboxGroup forwards the resolved color and size to its items, so theme defaults reach the checkboxes. Without it,
<UTheme :props="{ checkboxGroup: { color: 'success' } }">styled nothing: the items areUCheckbox, so their own proxy readsapp.config.ui.checkboxand nevercheckboxGroup, anduseFormFieldblocks the field injection for nested inputs so they can't pick it up from there either. It matters more than it looks, because everycolorvariant in the checkbox-group theme is an empty object outside thetablecompound variants, so forwarding is the only thing that prop does on the defaultlistvariant.highlightis deliberately left alone. It hits the same Boolean cast asdisabledabove, and||there would let a theme default override an explicithighlight={false}, so the fix belongs in the prop declaration rather than the call site.SelectMenu / InputMenu declared
timeoutIdinsideonUpdateOpen, so theclearTimeoutin the reopen branch always clearedundefinedand the pendingsearchTermreset fired anyway. Hoisting it to setup scope makes the cancel work, so reopening a menu within 100ms keeps the typed filter instead of silently wiping it.The rest is dropping
?.on a few size computeds that are never undefined (Input,InputTags,Textarea, and the same two menus).📝 Checklist