Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to canary, this PR will be updated.

Releases

@heroui/[email protected]

Patch Changes

  • #6041 5ec842b Thanks @brianatdetections! - Fix race condition in use-image hook that caused cached images to remain invisible (stuck at opacity-0) on Firefox and Safari.

    Root Cause:
    Event handlers (onload/onerror) were attached AFTER setting the image src. For cached images, the browser fires onload synchronously when src is set, causing the event to be missed. This is particularly prevalent in Firefox and Safari due to their JavaScript execution timing characteristics.

    Solution:

    • Attach onload/onerror handlers BEFORE setting src
    • Check both naturalWidth AND naturalHeight (per CodeRabbit review feedback on fix(use-image): load images after props change #4523)
    • Handle synchronous error callbacks for failed cached images
    • Include ignoreFallback in useCallback dependencies to prevent stale closures when prop changes dynamically
    • Add comprehensive test coverage including synchronous callback scenarios and dynamic ignoreFallback changes

    Fixes [BUG] - Cached avatar don't reset opacity 0 #4534, [BUG] - Image component: loading="lazy" not working #2259

  • Updated dependencies [5ec842b]:

@heroui/[email protected]

Patch Changes

  • #6041 5ec842b Thanks @brianatdetections! - Fix race condition in use-image hook that caused cached images to remain invisible (stuck at opacity-0) on Firefox and Safari.

    Root Cause:
    Event handlers (onload/onerror) were attached AFTER setting the image src. For cached images, the browser fires onload synchronously when src is set, causing the event to be missed. This is particularly prevalent in Firefox and Safari due to their JavaScript execution timing characteristics.

    Solution:

    • Attach onload/onerror handlers BEFORE setting src
    • Check both naturalWidth AND naturalHeight (per CodeRabbit review feedback on fix(use-image): load images after props change #4523)
    • Handle synchronous error callbacks for failed cached images
    • Include ignoreFallback in useCallback dependencies to prevent stale closures when prop changes dynamically
    • Add comprehensive test coverage including synchronous callback scenarios and dynamic ignoreFallback changes

    Fixes [BUG] - Cached avatar don't reset opacity 0 #4534, [BUG] - Image component: loading="lazy" not working #2259

  • Updated dependencies [5ec842b]:

@heroui/[email protected]

Patch Changes

@heroui/[email protected]

Patch Changes

@heroui/[email protected]

Patch Changes

  • #6041 5ec842b Thanks @brianatdetections! - Fix race condition in use-image hook that caused cached images to remain invisible (stuck at opacity-0) on Firefox and Safari.

    Root Cause:
    Event handlers (onload/onerror) were attached AFTER setting the image src. For cached images, the browser fires onload synchronously when src is set, causing the event to be missed. This is particularly prevalent in Firefox and Safari due to their JavaScript execution timing characteristics.

    Solution:

    • Attach onload/onerror handlers BEFORE setting src
    • Check both naturalWidth AND naturalHeight (per CodeRabbit review feedback on fix(use-image): load images after props change #4523)
    • Handle synchronous error callbacks for failed cached images
    • Include ignoreFallback in useCallback dependencies to prevent stale closures when prop changes dynamically
    • Add comprehensive test coverage including synchronous callback scenarios and dynamic ignoreFallback changes

    Fixes [BUG] - Cached avatar don't reset opacity 0 #4534, [BUG] - Image component: loading="lazy" not working #2259

@vercel
Copy link

vercel bot commented Dec 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
heroui Ready Ready Preview, Comment Dec 27, 2025 6:30am
heroui-sb Ready Ready Preview, Comment Dec 27, 2025 6:30am

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - Cached avatar don't reset opacity 0

3 participants