Skip to content

Commit aa62588

Browse files
authored
Merge pull request #710 from edo-zhou/fix/prevOverlay
Fix recursive `_prevOverlay` chain blowing up `JSON.stringify` when `overrideOverlay` is called repeatedly
2 parents 80d9212 + fc21b34 commit aa62588

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
/docs/node_modules
88

99
.npmrc
10+
11+
.DS_Store

src/component/Overlay.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ export default class OverlayImp<E = unknown> implements Overlay<E> {
273273
}
274274

275275
override (overlay: Partial<Overlay<E>>): void {
276-
this._prevOverlay = clone(this)
276+
this._prevOverlay = clone({
277+
...this,
278+
_prevOverlay: null
279+
})
277280

278281
const {
279282
id,

0 commit comments

Comments
 (0)