Ngx-bootstrap: TABS fired select event

Created on 13 Feb 2018  路  12Comments  路  Source: valor-software/ngx-bootstrap

TABS fired select event if I allocated value in input.

"ngx-bootstrap": "^2.0.2",

comp(tabs) easy (hours) issue

Most helpful comment

I also believe that if they change the event name to something else, that this would fix this issue. Until then, put this in the event(s) that the (select) triggers.

(select)="doThisOnSelect($event)

doThisOnSelect(ev?: any)
{
if (!(ev instanceof TabDirective)) return;
...
}

All 12 comments

Please provide a reproduction of this issue.
You can use one of the starter templates:
Plunkr: https://plnkr.co/edit/0NipkZrnckZZROAcnjzB?p=preview
StackBlitz: https://stackblitz.com/edit/ngx-bootstrap?file=app%2Fapp.module.ts

@IlyaSurmay Reprod:
https://plnkr.co/edit/uL5wXt3W1nKsBYusR2Z4?p=preview

Just select the text in the input-field. This will trigger the (select) output of the tab, as can be seen by the console print

When going to be fix this bug?

Any update on this bug?

According to this issue on Angular's repo, this is expected behavior of angular. (event) listeners will listen for @Output() events and DOM events. Components should avoid using DOM event names. (select) should probably be renamed to something like (tabSelect)

I also believe that if they change the event name to something else, that this would fix this issue. Until then, put this in the event(s) that the (select) triggers.

(select)="doThisOnSelect($event)

doThisOnSelect(ev?: any)
{
if (!(ev instanceof TabDirective)) return;
...
}

Had same issue in version ^3.0.0, @clabough recommendation fixed it for me.

Same issue here! Isn't there any different event for that?

FYI, if someone else stumbles upon it: Together with this Firefox bug (nsLayoutUtils::GetNearestScrollableFrame) the browser tab may crash if child elements of the tab are removed in the (select) callback.

thank you @clabough - your fix worked for me as well

Awesome, @clabough solution worked. Thanks!

@clabough solution worked for me as well Thank you !!!! 馃憤 馃憤

Was this page helpful?
0 / 5 - 0 ratings