Skip to content

Commit 61d6ae4

Browse files
Gustedearl-warren
authored andcommitted
[GITEA] Use vertical tabs on issue filters
- This is actually go-gitea#19978 & go-gitea#19486 but was removed in one of the UI refactors of v1.20 - This is a very technical fix and is best explained in the CSS comments. But the short version: When there's an overflow being set, but you want an element to 'break out' of that overflow with `position: absolute`, it sometimes doesn't work! You need to set some CSS to let the browser know that the element needs to use an element outside of that overflow as 'clip parent'. - Resolves my internal frustration with the mobile UI constantly getting broken. (cherry picked from commit 879f842bed999190506e1d60508e7aede1a4be21) (cherry picked from commit 6099c9b41b9a135fb14b41304459056050abbbe2) (cherry picked from commit 0749d00b160033de0457e17baa1e000e68810d94) (cherry picked from commit ec6a5428a7f05d8e6d2e8a6c476b2b9d35656b0f) (cherry picked from commit 9d0bee784d387fac026d3dcc09f10e496a99a7c5)
1 parent 4b19215 commit 61d6ae4

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

web_src/css/repo/issue-list.css

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
}
1818

1919
@media (max-width: 767.98px) {
20-
.issue-list-toolbar-right .dropdown .menu {
21-
left: auto !important;
22-
right: auto !important;
23-
}
2420
.issue-list-navbar {
2521
order: 0;
2622
}
@@ -31,6 +27,37 @@
3127
.issue-list-search {
3228
order: 2 !important;
3329
}
30+
/* Don't use flex wrap on mobile as it takes too much vertical space.
31+
* Only set overflow properties on mobile screens, because while the
32+
* CSS trick to pop out from overflowing works on desktop screen, it
33+
* has a massive flaw that it cannot inherited any max width from it's 'real'
34+
* parent and therefor ends up taking more vertical space than is desired.
35+
**/
36+
.issue-list-toolbar-right .filter.menu {
37+
flex-wrap: nowrap;
38+
overflow-x: auto;
39+
overflow-y: hidden;
40+
}
41+
42+
/* The following few CSS was created with care and built with the information
43+
* from CSS-Tricks: https://css-tricks.com/popping-hidden-overflow/
44+
*/
45+
46+
/* It's important that every element up to .issue-list-toolbar-right doesn't
47+
* have a position set, such that element that wants to pop out will use
48+
* .issue-list-toolbar-right as 'clip parent' and thereby avoids the
49+
* overflow-y: hidden.
50+
*/
51+
.issue-list-toolbar-right .filter.menu > .dropdown.item {
52+
position: initial;
53+
}
54+
/* It's important that this element and not an child has `position` set.
55+
* Set width so that overflow-x knows where to stop overflowing.
56+
*/
57+
.issue-list-toolbar-right {
58+
position: relative;
59+
width: 100%;
60+
}
3461
}
3562

3663
#issue-list .flex-item-title .labels-list {

0 commit comments

Comments
 (0)