Skip to content

MatTab: selectedTabChange should not fire when the tab is changed programmatically #17889

@TheParad0X

Description

@TheParad0X

There should be a way to differentiate between a UI and a programmaticcally induced tab change. As of now, both cause the selectedTabChange: EventEmitter to emit.

My case is pretty simple: I want to display the currently opened Tab in the URL:

somePage?openedTab=1
somePage?openedTab=2

But I also want the corresponding tab to open when a URL pointing to a specific tab is navigated to. Ideally, the [selectedIndex] input should not cause (selectedTabChange) to fire.

Does this make sense?

Material 8.2.3, Angular 8.2.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tabsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions