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

TextInput contextMenuHidden does not hide autofill #43452

Open
believer opened this issue Mar 12, 2024 · 1 comment
Open

TextInput contextMenuHidden does not hide autofill #43452

believer opened this issue Mar 12, 2024 · 1 comment
Labels
Component: TextInput Related to the TextInput component. Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project.

Comments

@believer
Copy link

believer commented Mar 12, 2024

Description

In iOS 17 a new "Autofill" option was added to the context menu for <TextInput>. This option is not hidden when we use contextMenuHidden. We've tried using a combination of other props, such as autoComplete, keyboardType, and textContentType, but it always persists.

It's possible to hide it by adding pointerEvents="none" (or box-only), but we want to be able to interact with the field.

Steps to reproduce

  1. Add <TextInput contextMenuHidden>
  2. Focus field
  3. Press again in field, autofill is displayed

React Native Version

0.73.6

Affected Platforms

Runtime - iOS

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 14.3.1
  CPU: (10) arm64 Apple M2 Pro
  Memory: 94.11 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.2
    path: ~/Library/Caches/fnm_multishells/18549_1710269055352/bin/node
  Yarn:
    version: 1.22.19
    path: ~/code/seb/Spark-blackbird/apps/blackbird/node_modules/.bin/yarn
  npm:
    version: 9.8.1
    path: ~/Library/Caches/fnm_multishells/18549_1710269055352/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/rickard/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/rickard/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: "*"
  react-native:
    installed: 0.73.6
    wanted: "*"
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

None

Reproducer

https://snack.expo.dev/@believer/react-native-autofill-tooltip

Screenshots and Videos

Without contextMenuHidden With contextMenuHidden
IMG_1158 IMG_1159
@github-actions github-actions bot added the Component: TextInput Related to the TextInput component. label Mar 12, 2024
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Mar 13, 2024
@jakex7
Copy link
Contributor

jakex7 commented Mar 13, 2024

Hello everyone,
I've decided to try to fix this issue and have submitted my solution in Pull Request #43468
I would appreciate any feedback or suggestions on that 😃

facebook-github-bot pushed a commit that referenced this issue Apr 2, 2024
)

Summary:
This pull request resolves the issue #43452
Previously, when utilizing `contextMenuHidden`, the context menu wasn't entirely hidden as the "AutoFill" option remained visible. However, it's now possible to eliminate it using the menu builder.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] - hide AutoFill from context menu when using `contextMenuHidden`

Pull Request resolved: #43468

Test Plan:
Manual tests in RNTester:

https://github.com/facebook/react-native/assets/39670088/dc0f828c-f613-412d-b560-f3b795dd3ffb

Reviewed By: javache

Differential Revision: D54902269

Pulled By: tdn120

fbshipit-source-id: e0f3d3b5a0817db1c072caf2f01648432c7d868d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: TextInput Related to the TextInput component. Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project.
Projects
None yet
Development

No branches or pull requests

3 participants