react / react/react-native

TextInput contextMenuHidden does not hide autofill

Open
#43,452 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: TextInput Issue: Author Provided Repro
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the React Native TextInput handling for contextMenuHidden and reproduce the issue using the linked Snack on iOS 17.2. Verify the Autofill option remains hidden while the field stays interactive; done means contextMenuHidden also suppresses Autofill.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.