docs/bevy/release-content/migration-guides/number_input.md 571 B · 21 lines · raw · history

1 ---
2 title: "Add scrubbing / dragging to number_input widget"
3 pull_requests: [24636, 24701]
4 ---
5
6 The API for the `FeathersNumberInput` has changed. To programmatically update the value, instead
7 of triggering an `UpdateNumberInput` event, you should insert a `NumberInputValue` component.
8 This makes it easier to specify the initial value at creation.
9
10 ```wgsl
11 // BEFORE
12 commands.trigger(UpdateNumberInput {
13 entity: input_ent,
14 value: NumberInputValue::F32(new_value),
15 });
16
17 // AFTER
18 commands
19 .entity(input_ent)
20 .insert(NumberInputValue::F32(new_value));
21 ```