Skip to content

Commit 8a94c5f

Browse files
chenjpuchenjpu
andauthored
[M] remove dom keydown listener (#265)
Co-authored-by: chenjpu <bing.chen@hgcitech.com>
1 parent 53f2cd6 commit 8a94c5f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react/src/components/notebook/NotebookState.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ export const notebookStore = createStore<NotebookState>((set, get) => ({
227227
},
228228
dispose: (uid: string): void => {
229229
const notebooks = get().notebooks;
230-
notebooks.delete(uid);
230+
const notebook = notebooks.get(uid);
231+
if(notebook){
232+
notebook.adapter?.dispose();
233+
notebooks.delete(uid);
234+
}
231235
set((state: NotebookState) => ({ notebooks }));
232236
},
233237
setPortals: (portalsUid: ReactPortalsMutation) => {

0 commit comments

Comments
 (0)