Fix modals created with useModal not showing title defined in component #2878
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes an issue introduced in v0.40.0 where modals created with
useModal().create()were not displaying titles defined in the component itself.Problem
When using
useModalwith a custom component that defines its owntitleprop, the title would not display:The title "My title" would not appear in the rendered modal. However, if the title was passed directly to
create({ title: "My title" }), it would display correctly.Root Cause
In
orchestratorShared.ts, thebuildPromisefunction'ssetmethod was unconditionally settingtitleandbodyproperties to their resolved values, even when they wereundefined. This causedundefinedvalues to override the component's own prop definitions.Solution
Modified the
setmethod to only includetitleandbodyin the store update if they are explicitly defined and notundefined. This allows component-defined props to take precedence when no override is provided.Changes
packages/bootstrap-vue-next/src/composables/orchestratorShared.tsto conditionally settitleandbodypropertiespackages/bootstrap-vue-next/src/composables/orchestratorShared.spec.tsto verify the fixTesting
Closes #[issue number]
Original prompt
Fixes #2877
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.