-
Notifications
You must be signed in to change notification settings - Fork 6.7k
The timing of tab rendered (when CSS class active
is added to tab pane) is not consistent.
#4273
Comments
Just to fully understand, when you add your 50ms to the timer, are you adding it to the timer in your plunker? This smells like a race condition to me. I don't think it will change anything because I think they are the same, but if you want to watch an attribute, you use What happens if you use an |
@icfantv yes, adding 50ms to the timer in my plunkr fixes this.
|
So they ARE NOT the same. I'm still trying to wrap my head around why, and chatted with some people smarter than me. Essentially, Some light reading: |
@icfantv Sorry I rarely used |
@icfantv could you please reopen this issue? |
Going to close this issue in favor of #4836 - the tab API is buggy, and we need to fix the source of all the issues with a fresh & 100% improved API. |
Hi all,
In theory, if we scheduel a
$timeout
intabScope.active
$watcher
, the function schedueled by$timeout
should execute after a full $digest cycle, during that full cycle, CSS class should be added to tab pane. (because bootstrap.tabs usesng-class
, which shares the same full cycle)but see this plunkr, the timing is inconsistent. what causes this? It is possibly a bug.
This matters because in our current work we need to calculate DOM dimensions when tab toggles,
but
display:none
prevent that calculating.$timeout()
50ms fixes this, creating some helper directive forcing to addactive
CSS class intabScope.active
$watcher
also fixes this.The text was updated successfully, but these errors were encountered: