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

fix: allow to pass additional params to .dismiss() unintentionally #685

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Nov 13, 2024

📜 Description

Allow to pass additional params to KeyboardController.dismiss() method unintentionally.

💡 Motivation and Context

When we pass params unintentionally like onPress={KeyboardController.dismiss} then we will try to serialize big JS object to the native side, which eventually crash the application.

To avoid this I decided to wrap dismiss in additional function and always send empty params to a native function.

Closes #684

📢 Changelog

JS

  • removed undocumented addListener/removeListener methods from KeyboardController;
  • allow to pass any params to dismiss;
  • removed unnecessary functions nesting in KeyboardToolbar;

🤔 How Has This Been Tested?

Tested on CI.

📝 Checklist

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

@kirillzyusko kirillzyusko added the 🐛 bug Something isn't working label Nov 13, 2024
@kirillzyusko kirillzyusko self-assigned this Nov 13, 2024
Copy link
Contributor

github-actions bot commented Nov 13, 2024

📊 Package size report

Current size Target Size Difference
159566 bytes 159580 bytes -14 bytes 📉

@kirillzyusko kirillzyusko force-pushed the fix/dismiss-with-additional-param branch from f408ae1 to 2fa5f23 Compare November 14, 2024 13:09
@kirillzyusko kirillzyusko added the KeyboardToolbar Anything related to KeyboardToolbar component label Nov 14, 2024
@kirillzyusko kirillzyusko marked this pull request as ready for review November 14, 2024 13:24
@kirillzyusko kirillzyusko added the example Anything related to example project label Nov 14, 2024
@kirillzyusko kirillzyusko merged commit 3eb78be into main Nov 14, 2024
12 checks passed
@kirillzyusko kirillzyusko deleted the fix/dismiss-with-additional-param branch November 14, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working example Anything related to example project KeyboardToolbar Anything related to KeyboardToolbar component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling KeyboardController.dismiss causes Range Error
1 participant