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

bug(mat-select): Mat Select crashes Chrome tab and edge #28928

Closed
1 task done
rschulz-scisys opened this issue Apr 22, 2024 · 11 comments
Closed
1 task done

bug(mat-select): Mat Select crashes Chrome tab and edge #28928

rschulz-scisys opened this issue Apr 22, 2024 · 11 comments
Labels
needs triage This issue needs to be triaged by the team

Comments

@rschulz-scisys
Copy link

rschulz-scisys commented Apr 22, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

unknown

Description

We have a problem with the angular 15 select component, crashing the current chrome browser (124) at least on macos (intel and arm64 build) and also happens on current edge, but not on safari. In our component wrapper this only happens with multi select values, but on the official demo page the normal component also crashes the browser. The browser crashes as soon as you want to select on option and click to open the list

Reproduction

Go to the official angular15 docs at https://v15.material.angular.io/components/select/overview

click on any list that is not using native with a current chrome browser or edge
see directly the "Aw snap" page

Expected Behavior

show selection list when clicking in the list drop down

Actual Behavior

browser crash "Aw snap"

Environment

  • Angular: latest 15
  • CDK/Material: latest 15 (legacy and mdc)
  • Browser(s): Chrome 124, Edge 124
  • Operating System (e.g. Windows, macOS, Ubuntu): MacOS

Hint: Demo pages for Angular 16 and 17 work, only 15 crashes

@rschulz-scisys rschulz-scisys added the needs triage This issue needs to be triaged by the team label Apr 22, 2024
@iangus
Copy link

iangus commented Apr 22, 2024

Been seeing this issue as well, but unable to reproduce it on the 64-bit chrome build. We have been able to reproduce it on arm64 builds as described in the issue details.

@WillPoulson
Copy link

Also seeing this issue for any user who updates to the latest chrome.

@vtachkov
Copy link

Also happening for us, same situation as mentioned above.

@mateusduraes
Copy link

mateusduraes commented Apr 22, 2024

Also happening for me.
I was able to replicate it on both Chrome and Edge.
However, on Firefox, everything works fine.

@danielcornock
Copy link

We are having the same issues on Angular 16 using the legacy mat-select. Seems to not effect all instances but does effect most. Have attempted to upgrade to the latest minor version but no luck.

@fgfernandez0321
Copy link

There is an open discussion and solution here

@ErikZA
Copy link

ErikZA commented Apr 23, 2024

The same problem happens in angular version 14.3.0.
Chrome version 124.0.6367.61 (official version) 64-bit

Workaround to deal with the error!

export class AppComponent implements OnInit {
  public ngOnInit(): void {
    document.addEventListener('DOMNodeInserted', function () {
      const elements = document.querySelectorAll('[aria-owns]');

      elements.forEach(element => {
        element.removeAttribute('aria-owns');
      });
    });
  }
}

@JuliusPIV
Copy link

Confirmed issue affecting a significant population of our users.

@IslamElKassas
Copy link

The same problem happens in angular version 14.3.0. Chrome version 124.0.6367.61 (official version) 64-bit

Workaround to deal with the error!

export class AppComponent implements OnInit {
  public ngOnInit(): void {
    document.addEventListener('DOMNodeInserted', function () {
      const elements = document.querySelectorAll('[aria-owns]');

      elements.forEach(element => {
        element.removeAttribute('aria-owns');
      });
    });
  }
}

DOMNodeInserted is deprecated.
Instead use this code:

const ariaOwnsRemover$ = new MutationObserver((mutationsList) =>
        {
            for (const m of mutationsList) 
                if (m.attributeName === 'aria-owns')
                    (m.target as Element).removeAttribute('aria-owns');
        });

        ariaOwnsRemover$.observe(document, { attributes: true, subtree: true });

Tested with Angular 14 and Chrome 124

@qannoufoualid
Copy link

qannoufoualid commented Apr 29, 2024

i vote to close this because fixed in chromium 🎉 , https://issues.chromium.org/issues/335553723#comment148

@crisbeto
Copy link
Member

crisbeto commented May 3, 2024

Closing since this appears to be fixed upstream.

@crisbeto crisbeto closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests