Skip to content

onLoad callback on Image is missing the source attribute #2268

Open

Description

@Sharcoux

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?

Activity

  1. V1shvesh commented on May 24, 2022

    @V1shvesh

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

    Although it does deviate from the spec mentioned above.

  2. added this to the 0.19: Image milestone on Jul 4, 2022
  3. added 2 commits that reference this issue on Apr 10, 2023
    a74dd98
    36f46b3
  4. gustavo-bonfim commented on Sep 5, 2024

    @gustavo-bonfim

    I faced the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    has: prSubject of a pull requestproject:react-native-webIssue associated with react-native-web

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions