Skip to content

Commit cef5a42

Browse files
authored
[BUGFIX]: Fix all-documentations-menu versions, positioning and UX on mobile devices (#780)
1. **Fix versions not being displayed in the menu** - BEFORE: ![obraz](https://github.com/user-attachments/assets/11f442d4-dd61-4b9a-a5af-57c602d0631b) - AFTER: ![obraz](https://github.com/user-attachments/assets/283aa55f-bbb8-482d-9131-72556455e582) 2. **Fix stretched-link anchor tags being rendered over the menu** Due to implementation of Bootstrap's `stretched-link` class, anchor tags were rendered over all-documentations-menu popover window, making them clickable through the menu's background. Managed to fix this by unsetting the z-index of such anchor tags which got rid of the problem, and it seems that no cards were negatively impacted by this change (user is still able to click anywhere within the card) 3. **Fix visible height on mobile devices** On mobile devices the menu was partially covered by the floating button. In order to fix this, I've reduced the max height of the popover window and made it scrollable on mobile, now the menu shouldn't be covered by the button and I think this change is good for UX on mobile, as now user is certain that he is scrolling through a menu (previously to see all links within the menu, the whole page would be scrolled) - BEFORE: ![obraz](https://github.com/user-attachments/assets/2295be25-a90e-4cb2-89bd-feaf9e979809) - AFTER (notice the scrollbar thumb on the right hand-side of popver menu): ![obraz](https://github.com/user-attachments/assets/501395fd-0619-4a63-b0a6-9ecbf29b8a79)
1 parent 54382a4 commit cef5a42

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

packages/typo3-docs-theme/assets/js/all-documentations-menu.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class AllDocumentationMenu extends HTMLElement {
44

55
constructor() {
66
super();
7-
this.mainButton = this.createMainButton('All documentations');
7+
this.mainButton = this.createMainButton('All documentation');
88
this.appendChild(this.mainButton);
99

1010
this.initializeDocumentationsData()
@@ -105,14 +105,14 @@ class AllDocumentationMenu extends HTMLElement {
105105

106106
listItemElement.appendChild(anchorElement);
107107

108-
if (!documentation.versions || !documentation.versions.length) {
108+
if (!documentation.children || !documentation.children.length) {
109109
return listItemElement;
110110
}
111111

112112
const versionsElement = document.createElement('div');
113113
versionsElement.classList.add(this.createClassName('versions'));
114114

115-
for (const version of documentation.versions) {
115+
for (const version of documentation.children) {
116116
versionsElement.appendChild(this.createDocumentationVersionBadge(version))
117117
}
118118

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.stretched-link {
2+
&::after {
3+
z-index: unset !important;
4+
}
5+
}

packages/typo3-docs-theme/assets/sass/components/_allDocumentationMenu.scss

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040

4141
@media screen and (max-width: 768px) {
4242
padding: 1.5em;
43+
max-height: 70vh;
44+
overflow-y: auto;
4345
}
4446
}
4547

packages/typo3-docs-theme/assets/sass/theme.scss

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
// tweak bootstrap styles
2424
@import 'text';
25+
@import 'stretched-link';
2526

2627
// components
2728
@import 'components/accordion';

packages/typo3-docs-theme/resources/public/css/theme.css

+7-1
Original file line numberDiff line numberDiff line change
@@ -23415,6 +23415,10 @@ article ol li::marker {
2341523415
box-shadow: inset 0px 0px 2px 2px;
2341623416
}
2341723417

23418+
.stretched-link::after {
23419+
z-index: unset !important;
23420+
}
23421+
2341823422
.accordion {
2341923423
border-radius: var(--bs-accordion-border-radius);
2342023424
box-shadow: 2px 1px 6px rgba(32, 33, 36, 0.28);
@@ -24867,6 +24871,8 @@ figure.uml-diagram {
2486724871
@media screen and (max-width: 768px) {
2486824872
.all-documentations-menu-tooltip {
2486924873
padding: 1.5em;
24874+
max-height: 70vh;
24875+
overflow-y: auto;
2487024876
}
2487124877
}
2487224878
.all-documentations-menu-categories {
@@ -24927,7 +24933,7 @@ figure.uml-diagram {
2492724933
gap: 0.3em;
2492824934
}
2492924935
.all-documentations-menu-versions a {
24930-
background-color: #f2f2f2;
24936+
background-color: rgb(242.25, 242.25, 242.25);
2493124937
padding: 0 5px;
2493224938
font-size: 0.8em;
2493324939
border-radius: 0.4em;

packages/typo3-docs-theme/resources/public/js/theme.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)