Skip to content

Commit 66355ba

Browse files
genubenjamincanac
andauthored
fix(useOverlay): set props to original props when defaultOpen is set (#4308)
Co-authored-by: Benjamin Canac <[email protected]>
1 parent 4873b3a commit 66355ba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/runtime/composables/useOverlay.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function _useOverlay() {
4646
isMounted: !!defaultOpen,
4747
destroyOnClose: !!destroyOnClose,
4848
originalProps: props || {},
49-
props: {}
49+
props: { ...(props || {}) }
5050
})
5151

5252
overlays.push(options)
@@ -110,9 +110,7 @@ function _useOverlay() {
110110
const patch = <T extends Component>(id: symbol, props: Partial<ComponentProps<T>>): void => {
111111
const overlay = getOverlay(id)
112112

113-
Object.entries(props!).forEach(([key, value]) => {
114-
(overlay.props as any)[key] = value
115-
})
113+
overlay.props = { ...props }
116114
}
117115

118116
const getOverlay = (id: symbol): Overlay => {

0 commit comments

Comments
 (0)