diff options
author | bobzel <zzzman@gmail.com> | 2023-12-12 12:54:24 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-12-12 12:54:24 -0500 |
commit | 6951e98f1b863fe1f404d8bf532a9241e2371ec2 (patch) | |
tree | 191aa4392cb50c8b58017316f63249ae6d896019 /src | |
parent | 2e56299ddfca9cc9e8466b45170ce3f05ee64f15 (diff) |
from last - fix to remove overlay elements (doucment icons)
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/OverlayView.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/OverlayView.tsx b/src/client/views/OverlayView.tsx index e41113ca4..673432a60 100644 --- a/src/client/views/OverlayView.tsx +++ b/src/client/views/OverlayView.tsx @@ -143,11 +143,7 @@ export class OverlayView extends React.Component { @action addElement(ele: JSX.Element, options: OverlayElementOptions): OverlayDisposer { - const remove = action(() => { - const index = this._elements.indexOf(ele); - if (index !== -1) this._elements.splice(index, 1); - }); - this._elements.push( + const div = ( <div key={Utils.GenerateGuid()} className="overlayView-wrapperDiv" @@ -161,7 +157,11 @@ export class OverlayView extends React.Component { {ele} </div> ); - return remove; + this._elements.push(div); + return action(() => { + const index = this._elements.indexOf(div); + if (index !== -1) this._elements.splice(index, 1); + }); } @action |