Skip to content

Commit 7842991

Browse files
committed
fix(nav): auto set iOS black transition bg via css
1 parent 3a7addf commit 7842991

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

src/components/app/structure.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ ion-content.js-scroll > scroll-content {
209209

210210
[nav-viewport],
211211
[nav-portal],
212-
[tab-portal] {
212+
[tab-portal],
213+
.nav-decor {
213214
display: none;
214215
}

src/components/content/content.ios.scss

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
$content-ios-outer-background: #efeff4 !default;
88
$content-ios-padding: $content-padding !default;
99
$content-ios-margin: $content-margin !default;
10-
$content-ios-has-views-background: #000 !default;
10+
$content-ios-transition-background: #000 !default;
1111

1212
ion-content {
1313
background-color: $background-ios-color;
@@ -17,9 +17,21 @@ ion-content {
1717
background: $content-ios-outer-background;
1818
}
1919

20-
ion-nav.has-views,
21-
ion-tab.has-views {
22-
background: $content-ios-has-views-background;
20+
ion-page.show-page ~ .nav-decor {
21+
// when ios pages transition, the leaving page grays out
22+
// this is the black square behind all pages so they gray out
23+
position: absolute;
24+
top: 0;
25+
left: 0;
26+
z-index: 0;
27+
display: block;
28+
29+
width: 100%;
30+
height: 100%;
31+
32+
background: $content-ios-transition-background;
33+
34+
pointer-events: none;
2335
}
2436

2537

src/components/nav/nav-controller.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,9 +1324,6 @@ export class NavController extends Ion {
13241324
// class to the nav when it's finished its first transition
13251325
if (!this._init) {
13261326
this._init = true;
1327-
if (!this.isPortal) {
1328-
this._renderer.setElementClass(this.getNativeElement(), 'has-views', true);
1329-
}
13301327
}
13311328

13321329
} else {

src/components/nav/nav.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ import {ViewController} from './view-controller';
109109
*/
110110
@Component({
111111
selector: 'ion-nav',
112-
template: '<div #viewport nav-viewport></div><div nav-portal></div>',
112+
template: '<div #viewport nav-viewport></div><div class="nav-decor"></div><div nav-portal></div>',
113113
directives: [NavPortal],
114114
encapsulation: ViewEncapsulation.None,
115115
})

src/components/tabs/tab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ import {ViewController} from '../nav/view-controller';
123123
'[attr.aria-labelledby]': '_btnId',
124124
'role': 'tabpanel'
125125
},
126-
template: '<div #viewport></div>',
126+
template: '<div #viewport></div><div class="nav-decor"></div>',
127127
encapsulation: ViewEncapsulation.None,
128128
})
129129
export class Tab extends NavController {

0 commit comments

Comments
 (0)