react-native-paper-dropdown
react-native-paper-dropdown copied to clipboard
Added keyboardShouldPersistTaps prop
I encountered a problem when there is Dropdown and TextInput on the same screen.
Scenario: TextInput is focused and keyboard is open.
Action -- tap on Dropdown, the dropdown menu opens as expected Next, ton a menu option.
Expected: The option should be selected
Actual: Instead, the keyboard is dismissed, and the menu remains open. An additional tap on the menu option is needed to select it
Solution: set keyboardShouldPersistTaps='handled' or 'always' to the ScrollView inside the menu prevents the keyboard from being dismissed and the tap going through to the menu option.
I have exposed this prop as a prop of Dropdown
Summary by CodeRabbit
New Features:
- Enhanced the DropDown component with a new optional property
keyboardShouldPersistTaps. This allows users to control whether the keyboard should stay visible after a tap. This feature improves user interaction with the component, especially in scenarios where continuous typing is required.
Walkthrough
In this update, we've enhanced the DropDown component in our application. We've introduced a new optional prop keyboardShouldPersistTaps to the DropDownPropsInterface interface. This prop has been integrated into the ScrollView component, allowing for more flexible keyboard interactions.
Changes
| File | Summary |
|---|---|
src/DropDown.tsx |
Introduced a new optional prop keyboardShouldPersistTaps to the DropDownPropsInterface interface. This prop is now part of the ScrollView component, enhancing keyboard interaction. |
🍂 As November winds blow, we code and grow, 🐇
With each key tap, our DropDown adapts, 🍁
Celebrating changes, as the season rearranges, 🎉
Inclusivity in our code, a globally shared ode. 🌍
So here's to the joy of autumn's hue, 🍂
And to the changes we continue to pursue. 🛠️
Tips
Chat with CodeRabbit Bot (@coderabbitai)
- If you reply to a review comment from CodeRabbit, the bot will automatically respond.
- To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
- Note: Review comments are made on code diffs or files, not on the PR overview.
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Commands (invoked as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository.@coderabbitai helpto get help.@coderabbitai resolveto resolve all the CodeRabbit review comments.
Note: For conversation with the bot, please use the review comments on code diffs or files.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - The JSON schema for the configuration file is available here.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json