Commit 3353579
fix ReactScrollViewHelper.kt remove listeners logic (#51718)
Summary:
Pull Request resolved: #51718
## what
the current removing listeners code is not working. in prod, when removeScrollListener is called, it creates a new weakReference of the scroll listener and it would never match any existing weakreference listeners in the list. The remove action would end up removing nothing from the list.
This diff fixes the issue by iterating through the list and compare the obj
reference: https://stackoverflow.com/questions/6296051/how-to-remove-a-weakreference-from-a-list
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D75716993
fbshipit-source-id: af9eed218deb44e87317c19ffca7d227b96de8e21 parent ab9ff88 commit 3353579
1 file changed
Lines changed: 6 additions & 2 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| 227 | + | |
225 | 228 | | |
226 | 229 | | |
227 | | - | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
| 238 | + | |
235 | 239 | | |
236 | 240 | | |
237 | | - | |
| 241 | + | |
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
| |||
0 commit comments