Skip to content

Commit

Permalink
elyra-ai#2122 Expression builder - After expression validation, chars…
Browse files Browse the repository at this point in the history
… need to be entered twice to reflect (elyra-ai#2123)
  • Loading branch information
mikieyx authored Oct 14, 2024
1 parent 473cd99 commit 9ed6d70
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,16 @@ 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 } });
if (!isEqual(prevProps.value, this.props.value)) {
const selection = this.editor.state.selection.main;
this.editor.dispatch({
changes: {
from: 0,
to: this.getCodemirrorState()?.doc?.length,
insert: this.props.value },
selection: {
anchor: selection.anchor,
head: selection.head } });
}
}

Expand Down

0 comments on commit 9ed6d70

Please sign in to comment.