Skip to content

Commit 209866c

Browse files
Fix Keyboard observer not updating SliderValue (#19661)
# Objective When the `CoreSlider`s `on_change` is set to None, Keyboard input, like ArrowKeys, does not update the `SliderValue`. ## Solution Handle the missing case, like it is done for Pointer. ## Testing - Did you test these changes? Yes: core_widgets & core_widgets_observers in both examples one has to remove / comment out the setting of `CoreSlider::on_change` to test the case of `on_change` being none. - Are there any parts that need more testing? No not that I am aware of. - How can other people (reviewers) test your changes? Is there anything specific they need to know? Yes: core_widgets & core_widgets_observers in both examples one has to remove / comment out the setting of `CoreSlider::on_change` to test the case of `on_change` being none. - If relevant, what platforms did you test these changes on, and are there any important ones you can't test? I tested on linux + wayland. But it is unlikely that it would effect outcomes. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
1 parent 7c2289c commit 209866c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/bevy_core_widgets/src/core_slider.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ fn slider_on_key_input(
394394
trigger.propagate(false);
395395
if let Some(on_change) = slider.on_change {
396396
commands.run_system_with(on_change, new_value);
397+
} else {
398+
commands
399+
.entity(trigger.target())
400+
.insert(SliderValue(new_value));
397401
}
398402
}
399403
}

0 commit comments

Comments
 (0)