fix(NumberEdit): avoid calling setValue() to change the displayed string (#80)

This commit is contained in:
Raphael Coeffic
2022-10-31 19:17:52 +10:00
committed by GitHub
parent fcb0e2cf5d
commit a9b7f815f2
+4 -4
View File
@@ -122,19 +122,19 @@ class BaseNumberEdit: public FormField
void setPrefix(std::string value) void setPrefix(std::string value)
{ {
prefix = std::move(value); prefix = std::move(value);
setValue(currentValue); update();
} }
void setSuffix(std::string value) void setSuffix(std::string value)
{ {
suffix = std::move(value); suffix = std::move(value);
setValue(currentValue); update();
} }
void setZeroText(std::string value) void setZeroText(std::string value)
{ {
zeroText = std::move(value); zeroText = std::move(value);
setValue(currentValue); update();
} }
void enableInstantChange(bool value) void enableInstantChange(bool value)
@@ -181,7 +181,7 @@ class BaseNumberEdit: public FormField
void setDisplayHandler(std::function<std::string(int value)> function) void setDisplayHandler(std::function<std::string(int value)> function)
{ {
displayFunction = std::move(function); displayFunction = std::move(function);
setValue(currentValue); update();
} }
virtual void update() virtual void update()