Skip to content

Commit

Permalink
Cleanu
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 6, 2024
1 parent 2fb0ab7 commit c7950f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/egui/src/widgets/drag_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,11 @@ impl<'a> Widget for DragValue<'a> {

if response.clicked() {
ui.data_mut(|data| data.remove::<String>(id));
ui.memory_mut(|mem| {
mem.request_focus(id);
});
ui.memory_mut(|mem| mem.request_focus(id));
let mut state = TextEdit::load_state(ui.ctx(), id).unwrap_or_default();
state.set_ccursor_range(Some(text::CCursorRange::two(
epaint::text::cursor::CCursor::default(),
epaint::text::cursor::CCursor::new(value_text.chars().count()),
text::CCursor::default(),
text::CCursor::new(value_text.chars().count()),
)));
state.store(ui.ctx(), response.id);
} else if response.dragged() {
Expand Down

0 comments on commit c7950f1

Please sign in to comment.