Skip to content

Commit

Permalink
#2186 Expression Builder: Operation symbols and add field buttons can…
Browse files Browse the repository at this point in the history
…not add at the beginning of expression (#2187)

Signed-off-by: Michael Pavlik <[email protected]>
Co-authored-by: Michael Pavlik <[email protected]>
  • Loading branch information
mikieyx and Michael Pavlik authored Oct 9, 2024
1 parent 8c7c41a commit 5640aa3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class ExpressionBuilder extends React.Component {
const value = (typeof newValue === "string") ? newValue : newValue.toString();
const somethingSelected = this.getCodemirrorState()?.selection.ranges.some((r) => !r.empty);
let cursor = this.getCodemirrorState()?.selection.main.head;
if (cursor === 0 && !somethingSelected) { // TODO: Doesn't work when I explicitly set the cursor to 0
if (isNaN(cursor) && !somethingSelected) {
// When nothing selected, set cursor at the end of the line
this.editor.dispatch({ selection: { anchor: this.getCodemirrorState()?.doc.length } });
cursor = this.getCodemirrorState()?.selection.main.head;
Expand Down

0 comments on commit 5640aa3

Please sign in to comment.