chat-ui
eb7d041f - Fix chat auto-scroll on touch devices (iOS) (#2390)

Commit
16 days ago
Fix chat auto-scroll on touch devices (iOS) (#2390) * fix(chat): use instant scroll on touch to land the spacer pin on iOS On send, the chat inflates a tall bottom spacer and scrolls to the bottom so the just-sent user message pins near the top (ChatGPT-style). That scroll was issued with behavior: "smooth". On iOS, WebKit suppresses/defers programmatic scrolls during touch/momentum, and the deferred smooth animation only plays out once the gesture and stream settle — i.e. the view visibly scrolls up right as the reply finishes. Use an instant scroll on touch devices (pointer: coarse) so the spacer that was added is snapped into view immediately on send, with no late animation. Desktop keeps its smooth pin. The mobile pin behaviour itself is preserved. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZA6zBsc61PSuo8kg4yRB7 * fix(chat): use any-pointer:coarse so hybrid touch devices snap on send pointer:coarse only reflects the primary pointer, so a hybrid device (touch laptop, iPad with a trackpad) reports fine and keeps the smooth scroll that WebKit defers when touch-scrolling. Switch to any-pointer:coarse so any touch-capable device snaps to the bottom immediately on send. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZA6zBsc61PSuo8kg4yRB7 --------- Co-authored-by: Claude <noreply@anthropic.com>
Author
Parents
Loading