Skip to content

Commit b58603f

Browse files
committed
iOS shared focus behavior with Android where input fields are focused on tap up rather than down. (#47)
1 parent 049c4fb commit b58603f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/core/items/text.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ impl Item for TextInput {
807807
self.as_ref().anchor_position_byte_offset.set(clicked_offset);
808808
}
809809

810-
#[cfg(not(target_os = "android"))]
810+
#[cfg(not(any(target_os = "android", target_os = "ios")))]
811811
self.ensure_focus_and_ime(window_adapter, self_rc);
812812

813813
match click_count % 3 {
@@ -826,13 +826,13 @@ impl Item for TextInput {
826826
return InputEventResult::GrabMouse;
827827
}
828828
MouseEvent::Pressed { button: PointerEventButton::Middle, .. } => {
829-
#[cfg(not(target_os = "android"))]
829+
#[cfg(not(any(target_os = "android", target_os = "ios")))]
830830
self.ensure_focus_and_ime(window_adapter, self_rc);
831831
}
832832
MouseEvent::Released { button: PointerEventButton::Left, .. } => {
833833
self.as_ref().pressed.set(0);
834834
self.copy_clipboard(window_adapter, Clipboard::SelectionClipboard);
835-
#[cfg(target_os = "android")]
835+
#[cfg(any(target_os = "android", target_os = "ios"))]
836836
self.ensure_focus_and_ime(window_adapter, self_rc);
837837
}
838838
MouseEvent::Released { position, button: PointerEventButton::Middle, .. } => {

0 commit comments

Comments
 (0)