Repository navigation
Commit e560782
Summary:
Pull Request resolved: #58862
`ImageProps` defaulted `resizeMode` to `stretch`, while the JS `Image` default, the documented default and every Android image view use `cover`. On Android, props equal to their C++ default are not sent when a view is created, so an explicit `resizeMode="stretch"` never reached the view and the image rendered as `cover`.
The C++ default is now `cover`. `Image` always sends `resizeMode` on every platform, so the value components receive is unchanged, and iOS initializes its content mode from the default props.
Changelog: [General][Fixed] - Fix explicit `resizeMode="stretch"` being ignored on newly created Android `Image`s
Reviewed By: javache, christophpurrer
Differential Revision: D123029410
fbshipit-source-id: bd9383c68cefc39749ab7f056a4f70a74efd2baa
1 parent 1c7a66b commit e560782
3 files changed
Lines changed: 8 additions & 18 deletions
File tree
- packages/react-native
- Libraries/Image/__tests__
- ReactCommon/react/renderer/components/image
Lines changed: 6 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 39 | + | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | 46 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 47 | + | |
58 | 48 | | |
59 | 49 | | |
60 | 50 | | |
| |||
282 | 272 | | |
283 | 273 | | |
284 | 274 | | |
285 | | - | |
| 275 | + | |
286 | 276 | | |
287 | 277 | | |
288 | 278 | | |
| |||
294 | 284 | | |
295 | 285 | | |
296 | 286 | | |
297 | | - | |
| 287 | + | |
298 | 288 | | |
299 | 289 | | |
300 | 290 | | |
301 | | - | |
| 291 | + | |
302 | 292 | | |
303 | 293 | | |
304 | 294 | | |
305 | 295 | | |
306 | 296 | | |
307 | 297 | | |
308 | 298 | | |
309 | | - | |
| 299 | + | |
310 | 300 | | |
311 | 301 | | |
312 | 302 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments