Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ts/WoltLabSuite/Core/Ui/User/Menu/View.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { UserMenuButton, UserMenuData, UserMenuFooter, UserMenuProvider } from "
import { getTimeElement } from "../../../Date/Util";
import { escapeHTML } from "../../../StringUtil";
import * as DomChangeListener from "../../../Dom/Change/Listener";
import * as Environment from "../../../Environment";
import * as Language from "../../../Language";
import { createFocusTrap, FocusTrap } from "focus-trap";
import PerfectScrollbar from "perfect-scrollbar";
Expand Down Expand Up @@ -49,17 +50,22 @@ export class UserMenuView {
fallbackFocus: this.element,
});

// Perfect Scrollbar emulates the scrolling through touch events which
// causes iOS to suppress the synthesized `click` event of the next tap.
// Touch devices must use the native scrolling instead.
const supportsPerfectScrollbar = Environment.platform() === "desktop";

UiScreen.on("screen-lg", {
match: () => {
this.usePerfectScrollbar = true;
this.usePerfectScrollbar = supportsPerfectScrollbar;
this.rebuildScrollbar();
},
unmatch: () => {
this.usePerfectScrollbar = false;
this.rebuildScrollbar();
},
setup: () => {
this.usePerfectScrollbar = true;
this.usePerfectScrollbar = supportsPerfectScrollbar;
this.rebuildScrollbar();
},
});
Expand Down
11 changes: 8 additions & 3 deletions wcfsetup/install/files/js/WoltLabSuite/Core/Ui/User/Menu/View.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions wcfsetup/install/files/style/ui/userMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ html:not(.touch) .userMenuButton {
}
}

/* Touch devices do not use Perfect Scrollbar, they rely on the native scrolling. */
html.mobile .userMenuContent.userMenuContentScrollable {
@include screen-lg {
overflow: hidden auto;
}
}

.userMenuItem {
background-color: var(--wcfUserMenuBackground);
display: grid;
Expand Down
Loading