Md-expansion panel opened and close events not firing on prod build (beta.11)
See original GitHub issueBug, feature request, or proposal:
Looks like a bug.
What is the expected behavior?
Event handler is invoked when opened and closed events happen.
What is the current behavior?
Event handler is not invoked on opened and closed events.
What are the steps to reproduce?
Attach handlers for such events in the template and check if they are invoked after being built with angular cli’s ng build --prod.
What is the use-case or motivation for changing an existing behavior?
Has to be working in production build
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?
I’m attaching event handlers like this:
<md-expansion-panel (closed)="onCollapse()" (opened)="onExpand()">
and process them in component. But these handlers are not invoked after prod build. It works OK when I do ng build --dev or ng serve.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:15
- Comments:22 (4 by maintainers)
Top Results From Across the Web
Angular Material mat-expansion-panel opened event always ...
This is by design; the docs site specifies that the type of the opened event is void , so the event contains nothing....
Read more >Expansion Panel | Angular Material
The <mat-expansion-panel-header> shows a summary of the panel content and acts as the control for expanding and collapsing. This header may optionally ...
Read more >CHANGELOG_ARCHIVE.md - components - Fossies
autofill: avoid firing unnecessary event on initial render of input (#12116) ... with disabled autocomplete and no panel (#11881) (6b1a672), closes #11876 ...
Read more >Visual Studio 2022 Preview Release Notes | Microsoft Learn
Get the latest pre-release features, bug fixes, and support for Visual Studio 2022 Preview. Download today.
Read more >Angular 6 error show is not a known element - iTecNote
I am trying to use Angular Material in Angular 6 project but getting errors. 'mat-panel-title' is not a known element: 'mat-panel-description' is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @josephperrott .
If you’re like me and just upgraded your project and even ran the md -> mat upgrade so you really don’t want to rollback, you can get by with this horrible hack:
This won’t work if people use the keyboard to open and close a panel but it’ll get me by until the next version is out.
Edit: Just a heads up that I had some issues with my former workaround as it would sometimes fire the click event if you clicked something inside the expansion panel. Moving the click event handler down to the ‘mat-expansion-panel-header’ fixed the issue for me
@marxxxx no, the issue is reproducible in beta.12.