Open
Description
What is the expected behavior?
I want to create some UI elements inside sort-header cell and want them to be available. Now it works fine in Chrome and Edge.
What is the current behavior?
The problem is that all content inside heading cell with sorting is wrapped into button
src/lib/sort/sort-header.html
<button class="mat-sort-header-button" type="button"
[attr.disabled]="_isDisabled() || null"
[attr.aria-label]="_intl.sortButtonLabel(id)"
(focus)="_setIndicatorHintVisible(true)"
(blur)="_setIndicatorHintVisible(false)">
<ng-content></ng-content>
</button>
But in Firefox clicking any children elements won't work because it is nested inside a button. See issue on StackOverflow.
What are the steps to reproduce?
Open StackBlitz and try clicking red button.
Chrome, Edge - you'll have alert message.
Mozilla Firefox - no messages.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Any Mozilla Firefox.
Is there anything else we should know?
My suggestion is to use <a href="#">
instead of button
. Then behaviour would be the same in every browser. Using of a
tag is not such nice as div
, but it allows to keep tab-navigation.