react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

onLoad callback on Image is missing the source attribute

Open Sharcoux opened this issue 3 years ago • 2 comments

The problem

Here is what the event looks like on onLoad:

image

But here is what the documentation tells us:

image

As you can see, the source attribute is missing.

How to reproduce

Simplified test case: here

Steps to reproduce:

  1. Create an Image
  2. Add an onLoad method
  3. Notice that the event.nativeEvent doesn't include the source attribute

Expected behavior

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.17.6
  • React (version): 17.0.2
  • Browser: 98.0.2 (64 bits)

Without this event, is there another way to detect the original width/height of the image?

Sharcoux avatar Apr 01 '22 13:04 Sharcoux

@Sharcoux seems like you might find the image height and width here: image

Although it does deviate from the spec mentioned above.

V1shvesh avatar May 24 '22 14:05 V1shvesh