microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.24k stars 2.7k forks source link

[Bug]: props: onLoadingStateChange of image component returns wrong ImageLoadState enum when image does not load in browser #26399

Closed sk1649 closed 1 year ago

sk1649 commented 1 year ago

Library

React / v8 (@fluentui/react)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (28) x64 Intel(R) Core(TM) i9-10940X CPU @ 3.30GHz
    Memory: 38.55 GB / 63.72 GB
  Browsers:
    Edge: Spartan (44.22621.1105.0), Chromium (109.0.1518.55)
    Internet Explorer: 11.0.22621.1

Are you reporting Accessibility issue?

None

Reproduction

NA

Bug Description

Actual Behavior

When image does not load , callback prop : onLoadingStateChange of Image component, gets invoke with enum = 1 (image load successfully) as argument . This happens intermittently.

Expected Behavior

When image does not load , callback prop : onLoadingStateChange of Image component, should get invoke with enum = 2 (image does not load) as argument.

Logs

No response

Requested priority

Normal

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

layershifter commented 1 year ago

@sk1649 I noticed what you wrote that the issue happens intermittently, but without a reproduction case we cannot debug the problem. I tried to repro and it works as expected (https://codesandbox.io/s/competent-knuth-l7y9bq?file=/src/App.tsx).

Can you please provide a reproduction case? 🙏

msft-fluent-ui-bot commented 1 year ago

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fluent UI!