Shopify / Shopify/flash-list

WebView injectedJavaScript won't run in v2

Open
#1,794 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2 v2.0
Dominant language
TypeScript
Stars
7.2k
Forks
393
Avg merge
1d 3h
Merged PRs (30d)
1

Description

Current behavior

I am on @shopify/flash-list 2.0.0-rc.11. When I use a WebView inside an item with injectedJavaScript, the javascript injected doesn't run

Expected behavior

The injectedJavaScript runs as if it's not inside the item.

To Reproduce

It's could be very simple, you can try to change the background color with injectedJavaScript in WebView. You will see that outside of the item it works correctly, and inside the item the injectedJavaScript doesn't work.

Platform:

  • iOS
  • Android

Environment

x.y.z

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 a minimal WebView using injectedJavaScript inside a FlashList item and compare it with the same WebView outside the item on iOS and Android. Verify the background-color reproduction and consider the issue done when injected JavaScript runs consistently in both placements.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.