react-native-modal-picker icon indicating copy to clipboard operation
react-native-modal-picker copied to clipboard

keyboardShouldPersisTaps={true} is deprecated, use keyboardShouldPersisTaps="always" instead

Open jaspal747 opened this issue 8 years ago • 8 comments

Getting the warning: "keyboardShouldPersisTaps={true} is deprecated, use keyboardShouldPersisTaps="always" instead"

react-native: "0.44.0" react-native-modal-picker: "0.0.16"

Thanks a lot for this awesome plugin 👍

jaspal747 avatar Jun 14 '17 20:06 jaspal747

As I wrote in another issue, this issue has four open PRs (#32, #40, #49, #52) that all does the same thing: appends ="always" to the keyboardShouldPersistTaps-prop in ScrollView on line 134. It also exists numerous issues pointing out this problem.

But since this repo is no longer maintained, you are better of forking it yourself and applying the PR-s that looks good, or use one of the 119 forks that already exists (many of them have done good progress).

UPDATE: Use react-native-modal-selector, it has implemented the fix for this, and will implement any future fixes as well

mikaello avatar Jun 16 '17 11:06 mikaello

Thanks @mikaello for your reply! Using one of the updated forks now.

jaspal747 avatar Jun 17 '17 03:06 jaspal747

It would be better to allow the parent to pass the prop keyboardShouldPersistTaps to this component. This would not only allow backward compatibility with older versions of RN, but also allow current RN users to choose the different values for keyboardShouldPersistTaps: always, handled, never.

peacechen avatar Jul 19 '17 22:07 peacechen

PR #62 adds prop keyboardShouldPersistTaps to react-native-modal-picker. It defaults to 'always' but allows the caller to override the prop in order to support any version of RN.

Until dan merges, you can use my fork with this commit:

  "dependencies": {
    "react-native-modal-picker": "https://github.com/peacechen/react-native-modal-picker#keyboardShouldPersistTaps_prop",
  },

That also includes PR #37

peacechen avatar Jul 21 '17 20:07 peacechen

@peacechen Thanks, but using your PR throws me a warning from yarn: Warning: Installed version 0.0.16 of 'react-native-modal-picker' does not satisfy required version peacechen/react-native-modal-picker#keyboardShouldPersistTaps_prop Do you know how to fix that?

NhatAnh avatar Jul 23 '17 18:07 NhatAnh

@NhatAnh you should be able to ignore that warning. Looks like a problem with the parsing of the version from package.json if the url has a # to select a branch.

Someone else reported the same warning on yarn: https://github.com/yarnpkg/yarn/issues/3964

peacechen avatar Jul 24 '17 05:07 peacechen

Thx for this issue, i was searching for a solution too. :)

davidroman0O avatar Aug 16 '17 13:08 davidroman0O

You may want to try react-native-modal-selector which is the official continuation of this abandoned project.

peacechen avatar Aug 16 '17 15:08 peacechen