react-native-paper-dropdown icon indicating copy to clipboard operation
react-native-paper-dropdown copied to clipboard

Added keyboardShouldPersistTaps prop

Open zwigglers opened this issue 2 years ago • 1 comments

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.

zwigglers avatar Nov 02 '23 21:11 zwigglers

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 ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to 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.yaml file 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

coderabbitai[bot] avatar Nov 02 '23 21:11 coderabbitai[bot]