Open Shallowmallow opened 3 years ago
Ok found it.
For some reason, in this function _stepper.max is equal to 0.
instead use var step:Stepper = _component.findComponent("stepper-step", Stepper); and replace _stepper.min and _stepper.max with step.min and steo.max
private function onTextFieldFocusOut(event:FocusEvent) {
_stepper.removeClass(":active");
var textfield:TextField = _stepper.findComponent("stepper-textfield", TextField);
var step:Stepper = _stepper.findComponent("stepper-step", Stepper);
if (textfield != null) {
_stepper.pos = MathUtil.clamp(Std.parseFloat(textfield.text), step.min, step.max);
textfield.text = Std.string(_stepper.pos);
} else {
event.cancel();
}
}
On Haxe-ui openfl linux target
If you don't put a max value
The max is considered a 0.
Expected Behavior
If you don't put a max value
<number-stepper pos="30" step="10" width ="30%" />
The max should be considered an infiniteCurrent Behavior
If you don't put a max value
<number-stepper pos="30" step="10" width ="30%" />
The max is considered a 0.It's the same problem with minimums
Possible Solution
I haven't checked in detail yet, maybe I'll try in the next few days. But I suppose the problem is the null value public var min:Null;
public var max:Null;
Maybe it is considered 0 in MathUtil.clamp https://github.com/haxeui/haxeui-core/blob/35db371129336a9b592c12997db55b2e4cbd333b/haxe/ui/util/MathUtil.hx#L15-L27