11<template lang="html">
2- <section >
2+ <section :class = " { firefox: isFirefox() } " >
33 <div class =" history" >
4- <div id =" spacer" />
54 <div
65 class =" message"
76 v-for =" msg in history"
1211 <Announcement v-else-if =" msg.type == 'Announcement'" v-bind =" msg" />
1312 <div class =" text" v-else >{{ msg.text }}</div>
1413 </div>
15- <div id =" anchor" ref =" anchor" />
1614 </div>
1715 </section>
1816</template >
@@ -34,15 +32,11 @@ export default {
3432 methods: {
3533 getID (msg ) {
3634 return " msg-" + msg .hash ;
35+ },
36+ isFirefox () {
37+ // Browser detection of firefox
38+ return typeof InstallTrigger !== " undefined" ;
3739 }
38- },
39- mounted () {
40- setTimeout (
41- function () {
42- this .$refs [" anchor" ].scrollIntoView ();
43- }.bind (this ),
44- 50
45- );
4640 }
4741};
4842 </script >
@@ -54,42 +48,22 @@ export default {
5448 overflow-x : hidden ;
5549 display : flex ;
5650 height : 100% ;
57- flex-direction : column ;
51+ flex-direction : column-reverse ;
5852}
5953
6054.message {
6155 margin-top : $spacer ;
6256}
6357
64- /*
65- Problem: FireFox just doesn't scroll on a flexbox with flex-direction:column-reverse.
66-
67- | Potential Solution | Negatives | Positives |
68- | ----------------------------- | ---------------------------- | --------------------------- |
69- | flex-direction:column-reverse | Doesn't work on FireFox. | Works on everything except |
70- | on .history | | FireFox perfectly. |
71- | ----------------------------- | ---------------------------- | --------------------------- |
72- | transform: scaleY(-1) | Scroll direction is reversed | https://open.spotify.com/tr |
73- | on .history and .message | (doesn't affect mobile); | ack/5foxQ24C0x7W0B2OD46AJg? |
74- | | it's just really dumb | si=joaaiGIsTES52UQVX5bNoQ |
75-
76- https://open.spotify.com/track/5foxQ24C0x7W0B2OD46AJg?si=joaaiGIsTES52UQVX5bNoQ
77- .history,
78- .message {
79- transform: scaleY(-1);
80- }
81- */
58+ .firefox {
59+ .history {
60+ flex-direction : column !important ;
61+ }
8262
83- .history * {
84- overflow-anchor : none ;
85- }
86- #anchor {
87- flex : 0 ;
88- min-height : 1px ;
89- overflow-anchor : auto ;
90- }
91- #spacer {
92- height : calc (100% - 8vmin );
63+ .history ,
64+ .message {
65+ transform : scaleY (-1 );
66+ }
9367}
9468
9569.text {
0 commit comments