Chat2DB Edition
Chat2DB Community
Chat2DB Version
5.3.0
Deployment
Web
Operating System
macOS
Operating System Version
12
Database and Version
No response
Problem Summary
In InputIEditor, createElement calls ReactDOM.createRoot(inputContainer).render(...) inline and discards the root reference. onEnd only detaches the DOM node (removeChild) — the React fiber tree, state, effects, and event handlers inside the rendered component are never torn down. This leaks on every cell-edit open/close cycle in the canvas table (a frequent action). The same pattern exists for the date editor at :388.
Steps to Reproduce
- Open a result-set table in the canvas editor.
- Open and close cell editors repeatedly.
- Observe accumulated unmounted React roots / leaked handlers and state per edit cycle.
Expected Behavior
Store the root on the instance and call root.unmount() in onEnd (and before re-rendering if createElement can be called twice for the same instance).
Actual Behavior
blocks/CanvasTable/editor/InputIEditor/index.tsx:202 (InputEditor) and :388 (DateInputEditor):
ReactDOM.createRoot(inputContainer).render(
<InputReact textarea={this.textarea} defaultValue={value} ref={this.inputRef} />,
);
onEnd (line 241-243):
onEnd() {
if (this.inputContainer && this.container?.contains(this.inputContainer)) {
this.container.removeChild(this.inputContainer);
}
this.inputContainer = null;
No unmount() is ever called.
Logs
Screenshots or Additional Context
Fix: this.root = ReactDOM.createRoot(inputContainer) in createElement, then this.root?.unmount() in onEnd (mirroring the React createRoot imperative guidance).
Impact
Limited or cosmetic impact
Workaround
N/A
Submission Checklist
Chat2DB Edition
Chat2DB Community
Chat2DB Version
5.3.0
Deployment
Web
Operating System
macOS
Operating System Version
12
Database and Version
No response
Problem Summary
In
InputIEditor,createElementcallsReactDOM.createRoot(inputContainer).render(...)inline and discards the root reference.onEndonly detaches the DOM node (removeChild) — the React fiber tree, state, effects, and event handlers inside the rendered component are never torn down. This leaks on every cell-edit open/close cycle in the canvas table (a frequent action). The same pattern exists for the date editor at:388.Steps to Reproduce
Expected Behavior
Store the root on the instance and call
root.unmount()inonEnd(and before re-rendering ifcreateElementcan be called twice for the same instance).Actual Behavior
blocks/CanvasTable/editor/InputIEditor/index.tsx:202(InputEditor) and:388(DateInputEditor):onEnd(line 241-243):No
unmount()is ever called.Logs
Screenshots or Additional Context
Fix:
this.root = ReactDOM.createRoot(inputContainer)increateElement, thenthis.root?.unmount()inonEnd(mirroring the ReactcreateRootimperative guidance).Impact
Limited or cosmetic impact
Workaround
N/A
Submission Checklist