Skip to content

fix: align Picture-in-Picture docs and suppressMenuItems type#3964

Merged
Titozzz merged 2 commits into
react-native-webview:masterfrom
patrickwehbe:docs/fix-pip-default-and-suppressmenu-delete
Jul 11, 2026
Merged

fix: align Picture-in-Picture docs and suppressMenuItems type#3964
Titozzz merged 2 commits into
react-native-webview:masterfrom
patrickwehbe:docs/fix-pip-default-and-suppressmenu-delete

Conversation

@patrickwehbe

Copy link
Copy Markdown
Contributor

While reading the Reference docs I found two props where the documentation did not match the source code.

allowsPictureInPictureMediaPlayback default

The Reference says the default value is false, but the prop actually defaults to true:

  • src/WebView.ios.tsx: allowsPictureInPictureMediaPlayback = true
  • src/WebView.macos.tsx: allowsPictureInPictureMediaPlayback = true
  • The JSDoc in src/WebViewTypes.ts also states "The default value is true."

The NOTE directly under the prop in the docs already implies the default is true (it explains you must set it to false to restrict Picture in Picture), so the prose was self-contradictory. Updated the documented default to true.

suppressMenuItems and the delete value

The docs list delete as one of the possible suppressMenuItems values, and the iOS native code does support it: in apple/RNCWebViewImpl.m, stringFromAction: maps delete: to "delete", and canPerformAction:withSender: suppresses it when present.

However the exported SuppressMenuItem union in src/WebViewTypes.ts was missing delete, so suppressMenuItems={[delete]} failed type checking (Type delete is not assignable to type SuppressMenuItem). I added delete to the union so the documented, natively supported value type-checks. It is placed next to paste to match the ordering of the native action map.

No behavior changes, just a docs correction and the matching type addition.

…uItem

Reference.md listed two values that did not match the source of truth:

- allowsPictureInPictureMediaPlayback was documented with a default of
  `false`, but the prop defaults to `true` in src/WebView.ios.tsx and
  src/WebView.macos.tsx (both `= true`) and in the WebViewTypes.ts JSDoc.
  The NOTE just below the prop already implied the default is `true`.
  Corrected the documented default to `true`.

- The docs list `delete` as a valid suppressMenuItems value, and the iOS
  native code supports it (apple/RNCWebViewImpl.m maps `delete:` -> `delete`
  in stringFromAction and suppresses it in canPerformAction). But the
  exported SuppressMenuItem union omitted `delete`, so
  suppressMenuItems={['delete']} failed type checking. Added `delete` to the
  union so the documented, natively supported value type-checks.
@patrickwehbe
patrickwehbe requested a review from Titozzz as a code owner June 20, 2026 10:49
@Titozzz Titozzz changed the title docs: fix incorrect default and invalid value in Reference chore: fix incorrect default and invalid value in Reference Jul 11, 2026
@Titozzz Titozzz changed the title chore: fix incorrect default and invalid value in Reference fix: fix incorrect default and invalid value in Reference Jul 11, 2026
@Titozzz Titozzz changed the title fix: fix incorrect default and invalid value in Reference fix: align Picture-in-Picture docs and suppressMenuItems type Jul 11, 2026
@Titozzz
Titozzz merged commit d65a961 into react-native-webview:master Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants