Skip to content

Bugfix: Only Dismiss Keyboard on User Scroll - #482

Open
fhasse95 wants to merge 1 commit into
skiptools:mainfrom
fhasse95:ScrollDismissesKeyboardMode-Bugfix
Open

Bugfix: Only Dismiss Keyboard on User Scroll#482
fhasse95 wants to merge 1 commit into
skiptools:mainfrom
fhasse95:ScrollDismissesKeyboardMode-Bugfix

Conversation

@fhasse95

@fhasse95 fhasse95 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

While testing a form with scrollDismissesKeyboard enabled, I noticed that the keyboard could be dismissed when the scroll was triggered programmatically. This can happen for example in cases where a focused TextField is scrolled into view using a ScrollViewProxy.

Example:

ScrollViewReader { proxy in
    Form {
        TextField("Notes", text: $notes)
            .id("notes")
            .onChange(of: isFocused) { _, isFocused in
                if isFocused {
                    proxy.scrollTo("notes", anchor: .bottom)
                }
            }
    }
    .scrollDismissesKeyboard(.immediately)
}

Before:
Before

After:
After

As you can see here, before the change the keyboard dismisses immediately, making it impossible for the user to input anything into the field.

This PR fixes the issue by making keyboard dismissal only react to actual user scroll gestures. Programmatic scroll updates can still move content into view, while manually scrolling the view continues to dismiss the keyboard as expected.

Update:
You can also reproduce this bug using the KeyboardScrollDismissPlayground in the Showcase app by, for example, positioning the TextField at the top of the List so that it isn't fully within the view, causing it to scroll into view automatically. You'll then see that it is dismissed immediately, even though the user hasn't actively scrolled.

Before:
Before Showcase

After:
After Showcase


Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.

Use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device
  • REQUIRED: I have checked whether this change requires a corresponding update in the Skip Fuse UI repository (link related PR if applicable)
  • OPTIONAL: I have added an example of any UI changes to the Showcase sample app

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

@cla-bot cla-bot Bot added the cla-signed label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant