diff --git a/lib/csv-editor-element.js b/lib/csv-editor-element.js index c99ced0..429fe3d 100644 --- a/lib/csv-editor-element.js +++ b/lib/csv-editor-element.js @@ -102,7 +102,12 @@ class CSVEditorElement extends HTMLElement { requestAnimationFrame(() => { this.updatePreview(this.collectOptions()) - this.model.applyChoice() + // Fix Issue #89 Uncaught TypeError: Cannot read property 'applyChoice' of undefined + try { + this.model.applyChoice() + } catch (e) { + this.destroy() + } }) } diff --git a/lib/table-element.js b/lib/table-element.js index 81b9bee..4ca1f9a 100644 --- a/lib/table-element.js +++ b/lib/table-element.js @@ -1306,8 +1306,9 @@ class TableElement extends HTMLElement { const cursorValue = cursor.getValue() this.editor.setText(String(cursorValue || this.getUndefinedDisplay())) - this.editor.getBuffer().history.clearUndoStack() - this.editor.getBuffer().history.clearRedoStack() + // Removed - Issue #93 (Uncaught TypeError: Cannot read property 'clearUndoStack' of undefined) + // this.editor.getBuffer().history.clearUndoStack() + // this.editor.getBuffer().history.clearRedoStack() if (initialData) { this.editor.setText(initialData) } }