Procházet zdrojové kódy

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 před 8 roky
rodič
revize
aa93a78372

+ 46
- 0
css/_vertical_filmstrip_overrides.scss Zobrazit soubor

@@ -2,6 +2,18 @@
2 2
  * Override other styles to support vertical filmstrip mode.
3 3
  */
4 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 17
     .filmstrip {
6 18
         align-items: flex-end;
7 19
         box-sizing: border-box;
@@ -78,6 +90,8 @@
78 90
         }
79 91
 
80 92
         #filmstripRemoteVideos {
93
+            @include minHWAutoFix();
94
+
81 95
             display: flex;
82 96
             flex: 1;
83 97
             flex-direction: column;
@@ -115,6 +129,8 @@
115 129
         }
116 130
 
117 131
         #remoteVideos {
132
+            @include minHWAutoFix();
133
+
118 134
             flex-direction: column;
119 135
             flex-grow: 1;
120 136
         }
@@ -224,3 +240,33 @@
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 Zobrazit soubor

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

Načítá se…
Zrušit
Uložit