Skip to content

Commit

Permalink
fix(nav): prevent flickers between views
Browse files Browse the repository at this point in the history
By default the scroll bar is being created for each view, then
immediately it adds the .scroll-bar-fade-out class. On every transition
you sometimes saw the scroll bar appear then fade away quickly. Sure
that was annoying and has been fixed to prevent that, but the real
issue is that on every view transition, the scroll bar’s opacity
transition fired off a transitionend event, which bubbled up to the
view and messed with Angular’s $animate. If timed out correctly, at the
time the scroll bar’s transitionend event bubbled up, and an element
was actively leaving the view, it would confuse $animate and cause the
leave animation to abruptly end, which caused an ugly flicker.
  • Loading branch information
adamdbradley committed Sep 17, 2014
1 parent 83d58d3 commit 03086ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/views/scrollView.js
Expand Up @@ -918,7 +918,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
var bar = document.createElement('div'),
indicator = document.createElement('div');

indicator.className = 'scroll-bar-indicator';
indicator.className = 'scroll-bar-indicator scroll-bar-fade-out';

if(direction == 'h') {
bar.className = 'scroll-bar scroll-bar-h';
Expand Down
3 changes: 1 addition & 2 deletions scss/_scaffolding.scss
Expand Up @@ -137,10 +137,9 @@ body.grade-c {
border-radius: 4px;
background: rgba(0,0,0,0.3);
opacity: 1;

@include transition(opacity .3s linear);

&.scroll-bar-fade-out {
@include transition(opacity 0.3s linear);
opacity: 0;
}
}
Expand Down

0 comments on commit 03086ed

Please sign in to comment.