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.

Tabset (change) event gets fired in non-related situations.

See original GitHub issue

Bug description:

Basically what happens is that if an is inside a tab, any method associated with the tabset’s (change) event will get fired if the input’s value changes (and the input loses focus).

So the event gets triggered if either a selected tab changes or if an input field’s value changes inside the tab changes.

My personal case is the following. On a (change) event I run code that changes the route to include the open tab in the parameters. One of the tabs has a form. By changing a form input value in that form, the route change function runs and another tab opens.

To make it work I’m using this hack:

onTabSelect(data: NgbTabChangeEvent) {
if (data.hasOwnProperty('nextId')) { 
            this._router.navigate(...);
        }   
}

Angular: 2.0.0

ng-bootstrap: 1.0.0.alpha-4

Bootstrap: 4.0.0.alpha-4

EDIT: I now realize I probably should have replied here instead: #594

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
pkozlowski-opensourcecommented, Sep 16, 2016

is your change a workaround for an angular issue, or is it expected behavior?

I expect it to be debated 😃 And I think that it actually makes sense to have a specific event name so it stands out in a template, hence the PR.

we should be very careful never to name an output as a standard dom event for directives that wrap content.

At least for events that bubble, yes.

BTW, the same bug probably also exists in accordion, which also has a change output.

Yes. I was just waiting for the reaction to my 1st PR 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to catch input change event when moving to another tab
Hello Lina, The change event for an input element is fired after the element loses focus. For dropdown controls it is fired automatically...
Read more >
Is there Selected Tab Changed Event in the standard WPF ...
I have tried using TabControl.SelectionChanged but it is getting fired many times when a child's selection within a tab is changed. wpf ·...
Read more >
Lightning Tabset tab change callback (LWC)
The Tab Component have an active Event which is fired everytime their content gets activated.
Read more >
Publication 598 (03/2021), Tax on Unrelated Business Income ...
A volunteer fire company conducts weekly public dances. Holding public dances and charging admission on a regular basis may, given the facts and ......
Read more >
Indexed Database API 3.0 - W3C
An event with type versionchange will be fired at an open connection ... The set of object stores can be changed, but only...
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