Skip to content

iOS Scroll freezes entire Rust event loop #1162

@rapporian

Description

@rapporian

iOS Scroll freezes entire Rust event loop

Problem

On iOS, all EventLoopProxy events are blocked while the user is scrolling. Events queue up and deliver only after scrolling stops.

This breaks every Tao-based iOS app that needs real-time updates during scroll.

Affected (anything using EventLoopProxy to reach the main thread):

  • Signal/state updates
  • Async task completions
  • Cross-thread UI communication

The Rust code runs, but the main thread never receives events until scroll stops.

Screen Recording of Issue

https://github.com/rapporian/ios-scroll-blocks-rust/raw/refs/heads/main/ScreenRecording.mp4

(Red dot = Rust, Green dot = JavaScript. Watch the red dot freeze during scroll while green continues.)

Reproduction

Repo: https://github.com/rapporian/ios-scroll-blocks-rust

Scroll the page. Watch the Rust-driven animation freeze while JavaScript requestAnimationFrame continues.

Root Cause

iOS run loop modes:

Mode When Active DefaultMode Observers CommonModes Observers
kCFRunLoopDefaultMode Normal ✅ Fire ✅ Fire
UITrackingRunLoopMode Scrolling ❌ Don't fire ✅ Fire

The run loop observers are registered for kCFRunLoopDefaultMode only. During scroll, iOS switches to UITrackingRunLoopMode — observers aren't registered for that mode, so they don't fire and events don't get processed.

Related

DioxusLabs/dioxus#5091

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions