-
-
Notifications
You must be signed in to change notification settings - Fork 516
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
Add API for imperative actions on RNSSearchBar #1523
Conversation
@kkafar I fixed the conflict and updated the docs, please let me know if it needs any improvements. We're using this in our internal builds for some time and it looks good so far. |
Hi @egegunes! I'll do it & let you know in couple of days. |
Sorry for the delay, I'm back on it. Your PR looks good and would be ready to merge, but I indeed encountered some issues while implementing the code for Fabric (can't get to codegened native commands w/o registering the |
@egegunes I've created a PR on your fork for supporting inserting value into the search bar. |
@kkafar since react native 0.71 has landed; is there anything preventing the Fabric issue from being solved? I would love this PR to get merged and would like to offer help if needed. |
Thank you for contribution! |
## Description This PR is a follow up to #1523 adding code for new React Native architecture. Status: * [x] iOS Paper * [x] iOS Fabric * [x] Android Paper * [x] Android Fabric TODO: * [x] Check when native commands (`dispatchCommand`) mechanism was introduced and back to what RN version is it compatible with Paper (seems to be working properly at least back to rn 0.68, need to check earlier versions) * [x] Implement Android * [x] Refine type declarations in `types.tsx` **Note**: while working on android implementation I've found few bugs <details> <summary>Scrollview does not respect header (Paper)</summary> <img width="745" alt="image" src="https://user-images.githubusercontent.com/50801299/218068165-b0ae7154-5444-49ae-8bf4-d3af6a9176c5.png"> </details> ## Changes Added following methods: * `focus()` * `blur()` * `clearText()` * `toggleCancelButton(show: boolean)` For usage please see `Test1097` in `TestsExample`. ## Test code and steps to reproduce Added `Test1097` in `FabricTestExample` && `TestsExample` ## Checklist - [x] Included code example that can be used to test this change - [x] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [x] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [x] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [x] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes --------- Co-authored-by: Ege Güneş <[email protected]>
Description
This changes allow users to manipulate the RNSSearchBar. For use cases please see discussions/1323.
Changes
ios/RNSSearchBar.mm
.src/index.native.tsx
to call native onesref
key toSearchBarProps
insrc/types.tsx
Test code and steps to reproduce
Added buttons to Example app to test each action:
Checklist