Remove focus from TextField when incrementing/decrementing using buttons.

This fixes the issue where the value that was in the textfield before typing would be incremented instead, if the textField had active focus.

CURA-8890
This commit is contained in:
j.delarago 2022-03-14 14:29:11 +01:00
parent c6326eff64
commit 0b82e9ef31

View File

@ -72,6 +72,18 @@ Item
base.value = value * base.stepSize;
}
// This forces TextField to commit typed values before incrementing with buttons.
// This fixes the typed value not being incremented when the textField has active focus.
up.onPressedChanged:
{
base.forceActiveFocus()
}
down.onPressedChanged:
{
base.forceActiveFocus()
}
background: Item {}
contentItem: Cura.TextField