Skip to content

Commit cd8a28b

Browse files
committed
fix(components): Only mark Input as dragging on the second press on android
1 parent 77572fc commit cd8a28b

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

crates/freya-components/src/input.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,13 @@ impl Component for Input {
481481
let on_input_focus_press = move |e: Event<FocusPressEventData>| {
482482
e.stop_propagation();
483483
e.prevent_default();
484-
is_dragging.set(true);
484+
if cfg!(target_os = "android") {
485+
if a11y_id.is_focused() {
486+
is_dragging.set_if_modified(true);
487+
}
488+
} else {
489+
is_dragging.set_if_modified(true);
490+
}
485491
movement_timeout.reset();
486492
if !display_placeholder {
487493
let area = area.read().to_f64();
@@ -499,7 +505,13 @@ impl Component for Input {
499505
let on_focus_press = move |e: Event<FocusPressEventData>| {
500506
e.stop_propagation();
501507
e.prevent_default();
502-
is_dragging.set(true);
508+
if cfg!(target_os = "android") {
509+
if a11y_id.is_focused() {
510+
is_dragging.set_if_modified(true);
511+
}
512+
} else {
513+
is_dragging.set_if_modified(true);
514+
}
503515
movement_timeout.reset();
504516
if !display_placeholder {
505517
editable.process_event(EditableEvent::Down {

0 commit comments

Comments
 (0)