Browse Source

fix(vertical-filmstrip): allow overflow scrolling on firefox, edge, and ie

Using column-reverse prevents proper scrolling on browsers other than Safari
and Chrome. Additionally, Firefox has an issue where flex containers have
dimensions set to auto, preventing resize. So, add hacks to maintain Chrome
and Safari's behavior while allowing for some kind of scrolling on other
browsers.
master
Leonard Kim 8 years ago
parent
commit
aa93a78372
2 changed files with 50 additions and 0 deletions
  1. 46
    0
      css/_vertical_filmstrip_overrides.scss
  2. 4
    0
      modules/UI/videolayout/Filmstrip.js

+ 46
- 0
css/_vertical_filmstrip_overrides.scss View File

2
  * Override other styles to support vertical filmstrip mode.
2
  * Override other styles to support vertical filmstrip mode.
3
  */
3
  */
4
 .vertical-filmstrip {
4
 .vertical-filmstrip {
5
+    /*
6
+     * Firefox sets flex items to min-height: auto and min-width: auto,
7
+     * preventing flex children from shrinking like they do on other browsers.
8
+     * Setting min-height and min-width 0 is a workaround for the issue so
9
+     * Firefox behaves like other browsers.
10
+     * https://bugzilla.mozilla.org/show_bug.cgi?id=1043520
11
+     */
12
+    @mixin minHWAutoFix() {
13
+        min-height: 0;
14
+        min-width: 0;
15
+    }
16
+
5
     .filmstrip {
17
     .filmstrip {
6
         align-items: flex-end;
18
         align-items: flex-end;
7
         box-sizing: border-box;
19
         box-sizing: border-box;
78
         }
90
         }
79
 
91
 
80
         #filmstripRemoteVideos {
92
         #filmstripRemoteVideos {
93
+            @include minHWAutoFix();
94
+
81
             display: flex;
95
             display: flex;
82
             flex: 1;
96
             flex: 1;
83
             flex-direction: column;
97
             flex-direction: column;
115
         }
129
         }
116
 
130
 
117
         #remoteVideos {
131
         #remoteVideos {
132
+            @include minHWAutoFix();
133
+
118
             flex-direction: column;
134
             flex-direction: column;
119
             flex-grow: 1;
135
             flex-grow: 1;
120
         }
136
         }
224
         }
240
         }
225
     }
241
     }
226
 }
242
 }
243
+
244
+/**
245
+ * Workarounds for Edge, IE11, and Firefox not handling scrolling properly
246
+ * with flex-direction: column-reverse. The remove videos in filmstrip should
247
+ * start scrolling from the bottom of the filmstrip, but in those browsers the
248
+ * scrolling won't happen. Per W3C spec, scrolling should happen from the
249
+ * bottom. As such, use css hacks to get around the css issue, with the intent
250
+ * being to remove the hacks as the spec is supported.
251
+ */
252
+@mixin undoColumnReverseVideos() {
253
+    #remoteVideos #filmstripRemoteVideos #filmstripRemoteVideosContainer {
254
+        flex-direction:column;
255
+    }
256
+}
257
+
258
+/** Firefox detection hack **/
259
+@-moz-document url-prefix() {
260
+    @include undoColumnReverseVideos();
261
+}
262
+
263
+/** IE11 detection hack **/
264
+@media screen and (-ms-high-contrast: active),
265
+screen and (-ms-high-contrast: none) {
266
+    @include undoColumnReverseVideos();
267
+}
268
+
269
+/** Edge detection hack **/
270
+@supports (-ms-ime-align:auto) {
271
+    @include undoColumnReverseVideos();
272
+}

+ 4
- 0
modules/UI/videolayout/Filmstrip.js View File

428
                 promises.push(new Promise(resolve => {
428
                 promises.push(new Promise(resolve => {
429
                     thumbs.localThumb.animate({
429
                     thumbs.localThumb.animate({
430
                         height: local.thumbHeight,
430
                         height: local.thumbHeight,
431
+                        'min-height': local.thumbHeight,
432
+                        'min-width': local.thumbWidth,
431
                         width: local.thumbWidth
433
                         width: local.thumbWidth
432
                     }, this._getAnimateOptions(animate, resolve));
434
                     }, this._getAnimateOptions(animate, resolve));
433
                 }));
435
                 }));
437
                 promises.push(new Promise(resolve => {
439
                 promises.push(new Promise(resolve => {
438
                     thumbs.remoteThumbs.animate({
440
                     thumbs.remoteThumbs.animate({
439
                         height: remote.thumbHeight,
441
                         height: remote.thumbHeight,
442
+                        'min-height': remote.thumbHeight,
443
+                        'min-width': remote.thumbWidth,
440
                         width: remote.thumbWidth
444
                         width: remote.thumbWidth
441
                     }, this._getAnimateOptions(animate, resolve));
445
                     }, this._getAnimateOptions(animate, resolve));
442
                 }));
446
                 }));

Loading…
Cancel
Save