Support horizontal scrolling on breadcrumbs
Fixes https://github.com/vector-im/riot-web/issues/8714 Fixes https://github.com/vector-im/riot-web/issues/8890 Fixes https://github.com/vector-im/riot-web/issues/9034 Fixes https://github.com/vector-im/riot-web/issues/8954 This turned out to be much more complicated than it needed to be. We use an IndicatorScrollbar to do all the math for us and some minor changes have been made so it can flag left/right overflow. The complicated part is the css changes which make the gradients work: unlike the RoomSubList, we have to calculate the offset of the indicators (gradients) on our own because position:sticky doesn't work horizontally. The changes to the css (well, mostly pointer-events:none) make it so the gradient doesn't interfere with the room avatars. 9034 and 8954 are fixed by this because they represent an overflow-x:none style breakage where browsers won't let you scroll without a scrollbar. The gradient offset problem is also demonstrated in 8954.
This commit is contained in:
parent
90d7e82399
commit
9b64dd0cd7
3 changed files with 95 additions and 16 deletions
|
@ -15,33 +15,29 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
.mx_RoomBreadcrumbs {
|
||||
overflow-x: auto;
|
||||
position: relative;
|
||||
height: 32px;
|
||||
height: 42px;
|
||||
margin: 8px;
|
||||
margin-bottom: 0;
|
||||
|
||||
overflow-x: hidden;
|
||||
overflow-x: visible;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
> * {
|
||||
margin-left: 4px;
|
||||
.mx_AutoHideScrollbar_offset {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 15px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
background: linear-gradient(to right, $panel-gradient);
|
||||
.mx_RoomBreadcrumbs_crumb {
|
||||
margin-left: 4px;
|
||||
height: 32px;
|
||||
display: inline-block;
|
||||
transition: transform 0.3s, width 0.3s;
|
||||
}
|
||||
|
||||
.mx_RoomBreadcrumbs_animate {
|
||||
margin-left: 0;
|
||||
transition: transform 0.3s, width 0.3s;
|
||||
width: 32px;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
@ -50,5 +46,34 @@ limitations under the License.
|
|||
width: 0;
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
|
||||
// Note: we have to manually control the gradient and stuff, but the IndicatorScrollbar
|
||||
// will deal with left/right positioning for us. Normally we'd use position:sticky on
|
||||
// a few key elements, however that doesn't work in horizontal scrolling scenarios.
|
||||
|
||||
.mx_IndicatorScrollbar_leftOverflowIndicator,
|
||||
.mx_IndicatorScrollbar_rightOverflowIndicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.mx_IndicatorScrollbar_leftOverflow .mx_IndicatorScrollbar_leftOverflowIndicator,
|
||||
&.mx_IndicatorScrollbar_rightOverflow .mx_IndicatorScrollbar_rightOverflowIndicator {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 15px;
|
||||
display: block;
|
||||
pointer-events: none;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.mx_IndicatorScrollbar_leftOverflowIndicator {
|
||||
background: linear-gradient(to left, $panel-gradient);
|
||||
}
|
||||
|
||||
.mx_IndicatorScrollbar_rightOverflowIndicator {
|
||||
background: linear-gradient(to right, $panel-gradient);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue