File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,23 @@ class PrintLayout extends Component {
39
39
}
40
40
}
41
41
42
+ /**
43
+ * Add print-view class to html tag to ensure that iOS scroll fix only applies
44
+ * to non-print views.
45
+ */
46
+ componentWillMount ( ) {
47
+ const root = document . getElementsByTagName ( 'html' ) [ 0 ]
48
+ root . setAttribute ( 'class' , 'print-view' )
49
+ }
50
+
51
+ /**
52
+ * Remove class attribute from html tag on clean up.
53
+ */
54
+ componentWillUnmount ( ) {
55
+ const root = document . getElementsByTagName ( 'html' ) [ 0 ]
56
+ root . removeAttribute ( 'class' )
57
+ }
58
+
42
59
render ( ) {
43
60
const { itinerary, companies } = this . props
44
61
return (
Original file line number Diff line number Diff line change 18
18
19
19
/* PREVENT BOUNCE SCROLL ON iOS */
20
20
@supports (-webkit-overflow-scrolling : touch) {
21
- /* Fix this body and html to prevent bounce */
22
- html ,
23
- body {
21
+ /* Fix the body and html to prevent bounce (only if print-view is not active) */
22
+ html : not (. print-view ) ,
23
+ html : not (. print-view ) body {
24
24
position : fixed;
25
25
overflow : hidden;
26
26
font-family : Arial, Helvetica, sans-serif;
27
27
}
28
- /* Modify the root/main div to permit normal scrolling behavior */
29
- # root , # main {
28
+ /* Modify the root/main div to permit normal scrolling behavior (only if
29
+ print-view is not active) */
30
+ html : not (.print-view ) # root ,
31
+ html : not (.print-view ) # main {
30
32
width : 100vw ;
31
33
height : 100vh ;
32
34
-webkit-overflow-scrolling : touch;
You can’t perform that action at this time.
0 commit comments