number_input: Do not trigger step event when the input is disabled (#568)

This commit is contained in:
Floyd Wang 2025-01-23 16:31:33 +08:00 committed by GitHub
parent a89e2430d3
commit 07b12b726c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,6 +110,10 @@ impl NumberInput {
}
fn on_step(&mut self, action: StepAction, cx: &mut ViewContext<Self>) {
if self.input.read(cx).disabled {
return;
}
cx.emit(NumberInputEvent::Step(action));
}
}