Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dismiss keeping focus #720

Merged
merged 9 commits into from
Dec 10, 2024
Merged

feat: dismiss keeping focus #720

merged 9 commits into from
Dec 10, 2024

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Dec 7, 2024

📜 Description

Added an ability to dismiss keyboard while keeping focus.

💡 Motivation and Context

📢 Changelog

Docs

  • added a note about using keepFocus flag;

E2E

  • cover "Close" screen with e2e test;

JS

  • added DismissOptions to dismiss method;
  • update spec and include keepFocus flag;
  • update examples app;

iOS

  • added KeyboardControllerModuleImpl file;
  • attach resign listener + tap gesture if field was dismissed with keepFocus;
  • remove resign listener and tap gesture if keyboard opens again or if responder was resigned;
  • enhance TextInput protocol with new props;
  • remove inputView when we call setFocusTo("current");

Android

  • call view.clearFocus() conditionally depending on keepFocus flag;

🤔 How Has This Been Tested?

Tested manually on:

  • Pixel 3a (API 33, emulator);
  • iPhone 15 Pro (iOS 17.5, simulator)

📸 Screenshots (if appropriate):

Keep focus Android iOS
Yes
telegram-cloud-document-2-5386359558685877476.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-12-10.at.12.00.00.mp4
No
telegram-cloud-document-2-5386318305524997022.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-12-10.at.11.59.12.mp4

📝 Checklist

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

@kirillzyusko kirillzyusko added documentation Improvements or additions to documentation enhancement New feature or request e2e Anything about E2E tests 🚨 requires API changes 🚨 Changes that requires changes in library API labels Dec 7, 2024
@kirillzyusko kirillzyusko self-assigned this Dec 7, 2024
Copy link
Contributor

github-actions bot commented Dec 7, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://kirillzyusko.github.io/react-native-keyboard-controller/pr-preview/pr-720/
on branch gh-pages at 2024-12-09 13:54 UTC

Copy link
Contributor

github-actions bot commented Dec 7, 2024

📊 Package size report

Current size Target Size Difference
164102 bytes 163366 bytes 736 bytes 📈

Copy link

argos-ci bot commented Dec 7, 2024

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Dec 10, 2024, 10:58 AM

@kirillzyusko kirillzyusko force-pushed the feat/dismiss-keep-focus branch from 2463a72 to 5eaa447 Compare December 9, 2024 09:29
@kirillzyusko kirillzyusko force-pushed the feat/dismiss-keep-focus branch from 5eaa447 to 1e059c0 Compare December 9, 2024 13:51
@kirillzyusko kirillzyusko added the example Anything related to example project label Dec 10, 2024
@kirillzyusko kirillzyusko marked this pull request as ready for review December 10, 2024 11:36
@kirillzyusko kirillzyusko merged commit 62b76d5 into main Dec 10, 2024
32 checks passed
@kirillzyusko kirillzyusko deleted the feat/dismiss-keep-focus branch December 10, 2024 12:12
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 example Anything related to example project 🚨 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