Skip to content

Commit

Permalink
elyra-ai#2066 RangeError when editing after validating incorrect expr…
Browse files Browse the repository at this point in the history
…ession

Signed-off-by: Veena S <[email protected]>
  • Loading branch information
veenas1 committed Jul 24, 2024
1 parent 487c46d commit b0b37a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions canvas_modules/common-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@codemirror/autocomplete": "^6.12.0",
"@codemirror/commands": "^6.3.3",
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/autocomplete": "^6.17.0",
"@codemirror/commands": "^6.6.0",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/lang-python": "^6.1.4",
"@codemirror/lang-sql": "^6.5.5",
"@codemirror/lang-sql": "^6.7.0",
"@codemirror/language": "^6.10.1",
"@codemirror/legacy-modes": "^6.3.3",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.23.1",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.28.6",
"@elyra/pipeline-schemas": "^3.0.68",
"codemirror": "^6.0.1",
"d3": "^7.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class ExpressionControl extends React.Component {
// this is needed to ensure expression builder selection works.
componentDidUpdate(prevProps) {
// When code is edited in expression builder, reflect changes in expression flyout
if (!isEqual(this.getCodemirrorState()?.doc.toString(), this.props.value)) {
this.editor.dispatch({ changes: { from: 0, to: this.getCodemirrorState()?.doc.length, insert: this.props.value } });
}
// Toggle editable mode in Codemirror editor
if (!isEqual(prevProps.state, this.props.state)) {
this.setCodeMirrorEditable(!(this.props.state === STATES.DISABLED) || !this.props.readOnly);
Expand All @@ -105,6 +102,9 @@ class ExpressionControl extends React.Component {
});
this.editor.focus();
}
if (!isEqual(this.getCodemirrorState()?.doc.toString(), this.props.value)) {
this.editor.dispatch({ changes: { from: 0, to: this.getCodemirrorState()?.doc?.length, insert: this.props.value } });
}
}

getCodemirrorState() {
Expand Down

0 comments on commit b0b37a3

Please sign in to comment.