fix: align Picture-in-Picture docs and suppressMenuItems type#3964
Merged
Titozzz merged 2 commits intoJul 11, 2026
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While reading the Reference docs I found two props where the documentation did not match the source code.
allowsPictureInPictureMediaPlaybackdefaultThe Reference says the default value is
false, but the prop actually defaults totrue:src/WebView.ios.tsx:allowsPictureInPictureMediaPlayback = truesrc/WebView.macos.tsx:allowsPictureInPictureMediaPlayback = truesrc/WebViewTypes.tsalso states "The default value istrue."The NOTE directly under the prop in the docs already implies the default is
true(it explains you must set it tofalseto restrict Picture in Picture), so the prose was self-contradictory. Updated the documented default totrue.suppressMenuItemsand thedeletevalueThe docs list
deleteas one of the possiblesuppressMenuItemsvalues, and the iOS native code does support it: inapple/RNCWebViewImpl.m,stringFromAction:mapsdelete:to"delete", andcanPerformAction:withSender:suppresses it when present.However the exported
SuppressMenuItemunion insrc/WebViewTypes.tswas missingdelete, sosuppressMenuItems={[delete]}failed type checking (Type delete is not assignable to type SuppressMenuItem). I addeddeleteto the union so the documented, natively supported value type-checks. It is placed next topasteto match the ordering of the native action map.No behavior changes, just a docs correction and the matching type addition.