Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated "unload" event listener used in AccordionDetails #45158

Closed
SerhiiStepanenko opened this issue Jan 31, 2025 · 2 comments
Closed

Deprecated "unload" event listener used in AccordionDetails #45158

SerhiiStepanenko opened this issue Jan 31, 2025 · 2 comments
Labels
component: accordion This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@SerhiiStepanenko
Copy link

SerhiiStepanenko commented Jan 31, 2025

Steps to reproduce

Steps:

  1. Install Material-UI version @mui/material: ^6.4.2.
  2. Use the AccordionDetails component in a React project.
  3. Open the browser DevTools and go to the Issues tab.
  4. Look for the warning: Unload event listeners are deprecated and will be removed.
  5. Run a Lighthouse audit (in the Best Practices section) — the same warning is reported there.

Current behavior

  • In the browser DevTools, under the Issues tab, a warning appears: Unload event listeners are deprecated and will be removed.
  • Lighthouse, in the Best Practices category, also flags the use of the deprecated unload event.
  • The warning originates from the AccordionDetails file within the Material-UI library.

Screenshot:
![DevTools Issues Tab]

Image

Expected behavior

  • The AccordionDetails component should not use deprecated events such as unload.
  • Lighthouse and DevTools should not display any warnings.
  • The Material-UI library should utilize modern methods to achieve the same functionality.

Context

  • This issue prevents achieving a 100% score in the Best Practices category of Lighthouse.
  • Warnings in DevTools complicate debugging and create a sense of code instability.
  • Deprecated methods may be removed in the future, potentially leading to errors in the production environment.

Your environment

  • Material-UI Version: 6.4.2
  • React Version: 17.0.2
  • Browser: Chrome 132.0.6834.160
  • Operating System: Windows 11

Search keywords: AccordionDetails Unload event listener deprecated Best Practices warning Lighthouse

@SerhiiStepanenko SerhiiStepanenko added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 31, 2025
@mj12albert mj12albert added the component: accordion This is the name of the generic UI component, not the React module! label Feb 3, 2025
@mj12albert
Copy link
Member

@SerhiiStepanenko Thanks for reporting this, would you mind providing a repro? You can fork this sandbox: https://codesandbox.io/p/sandbox/autumn-pond-v29s74

I don't see this console warning on the accordion docs page and it doesn't log that lighthouse issue when I run it

@mj12albert mj12albert added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 3, 2025
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: accordion This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

2 participants