number_input: Do not trigger step event when the input is disabled (#568)
This commit is contained in:
parent
a89e2430d3
commit
07b12b726c
1 changed files with 4 additions and 0 deletions
|
|
@ -110,6 +110,10 @@ impl NumberInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_step(&mut self, action: StepAction, cx: &mut ViewContext<Self>) {
|
fn on_step(&mut self, action: StepAction, cx: &mut ViewContext<Self>) {
|
||||||
|
if self.input.read(cx).disabled {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cx.emit(NumberInputEvent::Step(action));
|
cx.emit(NumberInputEvent::Step(action));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue