Skip to content

Commit

Permalink
Fix handling of textt-as-number for numeric text edit widget
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jul 19, 2024
1 parent 4c514d4 commit 85b94f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/qml/editorwidgets/TextEdit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ EditorWidgetBase {

DoubleValidator {
id: doubleValidator

locale: 'C'
}

Expand All @@ -80,7 +79,12 @@ EditorWidgetBase {
}

onTextChanged: {
valueChangeRequested(text, text == '');
if (field.isNumeric) {
let value = parseFloat(text);
valueChangeRequested(value, isNaN(value));
} else {
valueChangeRequested(text, text === '');
}
}
}

Expand Down

0 comments on commit 85b94f4

Please sign in to comment.