-
-
Notifications
You must be signed in to change notification settings - Fork 174
Fix BFormSelect modelValue not being applied during SSR #2835
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
Conversation
|
|
Co-authored-by: VividLemon <[email protected]>
|
@copilot this is missing documentation on the .data.ts files for new props that it has made. In addition to fixing this, make an update to the github copilot setup file so that you remember to make updates to the .data.ts files when you add new props, events, or slots |
Co-authored-by: VividLemon <[email protected]>
Added documentation for the new |
| disabledField?: string | ||
| label?: string | ||
| options?: readonly (unknown | Record<string, unknown>)[] | ||
| selectedValue?: unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Since these values are meant to only be "internal" set up a provide/inject bus that communicates this information. "default" values for inject will be null when possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've refactored the implementation to use a provide/inject pattern instead of the internal props. The changes include:
- Created a
formSelectKeyinjection key in utils/keys.ts with modelValue as readonly ref - Updated BFormSelect to provide the modelValue context
- Updated BFormSelectOption to inject the context and compute selected state internally
- Updated BFormSelectOptionGroup to remove prop passing (child components inject directly)
- Removed the
selectedandselectedValueprops from TypeScript interfaces
The inject default value is null as requested. All tests pass and the SSR functionality is preserved while removing the "internal" props from the public API. (202b0bd)
commit: |
Co-authored-by: VividLemon <[email protected]>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
packages/bootstrap-vue-next/src/components/BFormSelect/BFormSelect.vue
Outdated
Show resolved
Hide resolved
packages/bootstrap-vue-next/src/components/BFormSelect/BFormSelect.vue
Outdated
Show resolved
Hide resolved
* upstream/main: (32 commits) chore: release main (bootstrap-vue-next#2838) feat(BButtonToolbar): Add keyboard navigation support (bootstrap-vue-next#2837) fix(BFormSelect): modelValue not being applied during SSR (bootstrap-vue-next#2835) feat(BTable): Implement keyboard navigation (bootstrap-vue-next#2834) fix: BOffcanvas responsive SSR compatibility - defer breakpoint evaluation to client-side (bootstrap-vue-next#2833) chore: release main (bootstrap-vue-next#2831) fix(BDropdown): transition broken by inline display styles (bootstrap-vue-next#2832) feat: change useColorMode selector from 'body' to 'html' (bootstrap-vue-next#2830) chore: release main (bootstrap-vue-next#2817) feat: Add headerAttrs prop to BOffcanvas and BModal components docs: Add useScrollspy documentation fix: Remove lazy-modifier warning on FormInput docs (bootstrap-vue-next#2825) feat(BSort)!: Implement initial-sort-direction and move compare from sort-by to fields (bootstrap-vue-next#2777) docs(table): fix incorrect list item (bootstrap-vue-next#2823) docs: Fix grammar in documentation data files (bootstrap-vue-next#2816) doc(BTooltip): Parity pass (bootstrap-vue-next#2762) docs(BOverlay): Parity pass (bootstrap-vue-next#2767) feat: implement BFormRating disabled state (bootstrap-vue-next#2753) (bootstrap-vue-next#2793) docs: fix otp for index and reference pages (bootstrap-vue-next#2819) docs(BApp): add some additional details around legacy plugin use (bootstrap-vue-next#2820) ...
Addselectedprop to BFormSelectOption componentAddselectedValueprop to BFormSelectOptionGroup componentUpdate TypeScript interfaces for new propsThe initial implementation added
selectedandselectedValueprops to the child components, but based on feedback these were refactored to use Vue's provide/inject pattern instead. This creates a cleaner API by removing "internal" props that users shouldn't set manually, while maintaining the same SSR functionality.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.