Skip to content

feat: dismiss without animation#1127

Merged
kirillzyusko merged 5 commits intomainfrom
feat/dismiss-without-animation
Sep 30, 2025
Merged

feat: dismiss without animation#1127
kirillzyusko merged 5 commits intomainfrom
feat/dismiss-without-animation

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Sep 18, 2025

📜 Description

Added ability to hide keyboard instantly.

💡 Motivation and Context

This PR has been inspired by this post in twitter: https://x.com/klemensstrasser/status/1955284572825853957?t=Rui36_sZCd3pEoKFc02N9w&s=35

In this particular transition it makes sense to instantly hide the keyboard, so that main shared transition look consistent and additional animations don't distract the attention. So in this PR I'm adding a new option to dismiss method: animated. You can specify false and then keyboard will be dismissed instantly. By default this option is true, but when you develop complex shared animation transitions it may make sense to hide keyboard immediately 👀

The other reason why I am adding this is because I've seen in some projects (Expensify, for example) that keyboard may be hidden instantly in some edge cases (that was a reminder that you need to use onEnd for sync last animation frame). Now this is not the edge case, but something that we can control as well - so it will be easier to test various components, such as KeyboardAvoidingView/KeyboardAwareScrollView to assure they work consistently with immediate close too.

📢 Changelog

E2E

  • added new test for testing instant hide;
  • updated assets for close functionality;

Docs

  • added a note that you can hide keyboard without animation;

JS

  • added animated prop to types.ts.

iOS

  • hide keyboard using performWithoutAnimation if animated is true.

Android

  • hide keyboard using WindowInsetsController if animated is true.

🤔 How Has This Been Tested?

Tested on:

  • Pixel 7 Pro (Android 16);
  • iPhone 16 Pro (iOS 18).

📸 Screenshots (if appropriate):

Android iOS
telegram-cloud-document-2-5393546018224636187.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-09-30.at.12.26.02.mp4

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Sep 18, 2025
@kirillzyusko kirillzyusko added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 18, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 18, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-09-30 14:05 UTC

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 30, 2025, 1:18 PM

@kirillzyusko kirillzyusko added the 🚨 requires API changes 🚨 Changes that requires changes in library API label Sep 22, 2025
@kirillzyusko kirillzyusko force-pushed the feat/dismiss-without-animation branch from f38a107 to ef07cb9 Compare September 30, 2025 09:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 30, 2025

📊 Package size report

Current size Target Size Difference
224043 bytes 223762 bytes 281 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review September 30, 2025 10:27
@kirillzyusko kirillzyusko added the e2e Anything about E2E tests label Sep 30, 2025
@kirillzyusko kirillzyusko merged commit 692494f into main Sep 30, 2025
32 checks passed
@kirillzyusko kirillzyusko deleted the feat/dismiss-without-animation branch September 30, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation e2e Anything about E2E tests enhancement New feature or request 🚨 requires API changes 🚨 Changes that requires changes in library API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant