question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Tabs] Interrupt / Intercept tab change

See original GitHub issue

Bug, feature request, or proposal:

If possible, i want to intercept tab change, i know i have the MdTabChangeEvent through MdTabGroup’s selectChange binding, but it only seems to show which tab is it transitioning to, how do i stop the transition of happening?

What is the expected behavior?

I want a way to call a function, make some logic in function and then if i want, stop the tab from happening, or even change to a different tab, my case is that the last tab should be a +, and on click it should add a new tab instead of transitioning to that empty tab.

What is the current behavior?

Can’t find a way to intercept the transition of tabs.

What is the use-case or motivation for changing an existing behavior?

Using tabs for a step based process, or just having a + tab made for the sole purpose of adding more tabs, not showing that tab.

Which versions of Angular, Material, OS, browsers are affected?

material@2.0.0-alpha.10

Is there anything else we should know?

Idk if it exists or it lacks the feature itself, i guess that for the moment i’ll need to let it transition to the empty tab, add the new tab and then transition to the created tab.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:19
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
Daelusecommented, Nov 29, 2016

Slightly related to #2008, if we could bind to an EventEmitter output by the tab group which provides us the current tab, and the target tab, we would then probably only need a way to stop the index from changing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to conditionally prevent user from navigating to other ...
This does work to prevent tab change, but the tab information it receives is for the NEW tab requested, not the previously active...
Read more >
How to change tabs conditionally while using Angular ...
The solution 🕶 First, we need to add a click listener on the mat-tab-group and disable all tabs because if tabs are not...
Read more >
tabs.onActiveChanged - Mozilla - MDN Web Docs
Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event...
Read more >
Inserting and Editing Tab Stops
Change the tab stops for all paragraphs using the current Paragraph Style: Right-click the paragraph to open the context menu, choose Edit Paragraph...
Read more >
How to Remove Edge Browser Tabs From Alt+Tab on ...
Starting with the October 2020 update, Windows 10 now shows Microsoft Edge browser tabs in the Alt+Tab task switcher by default.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found