Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 85b7be7

Browse files
committed
Remove data-scrollbar workaround
1 parent 763edb7 commit 85b7be7

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

res/css/structures/_RoomView.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ limitations under the License.
7070
overflow-y: auto;
7171
flex: 1 1 0;
7272
overflow-anchor: none;
73-
74-
&[data-scrollbar=false] {
75-
overflow-y: hidden;
76-
}
7773
}
7874

7975
.mx_RoomView_messagePanelSearchSpinner {

src/components/structures/ScrollPanel.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import AutoHideScrollbar from "./AutoHideScrollbar";
2222
import { getKeyBindingsManager } from "../../KeyBindingsManager";
2323
import ResizeNotifier from "../../utils/ResizeNotifier";
2424
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
25-
import UIStore, { UI_EVENTS } from "../../stores/UIStore";
2625

2726
const DEBUG_SCROLL = false;
2827

@@ -209,8 +208,6 @@ export default class ScrollPanel extends React.Component<IProps> {
209208

210209
componentDidMount() {
211210
this.checkScroll();
212-
213-
UIStore.instance.on(UI_EVENTS.Resize, this.onUiResize);
214211
}
215212

216213
componentDidUpdate() {
@@ -233,8 +230,6 @@ export default class ScrollPanel extends React.Component<IProps> {
233230
if (this.props.resizeNotifier) {
234231
this.props.resizeNotifier.removeListener("middlePanelResizedNoisy", this.onResize);
235232
}
236-
237-
UIStore.instance.off(UI_EVENTS.Resize, this.onUiResize);
238233
}
239234

240235
private onScroll = ev => {
@@ -721,17 +716,6 @@ export default class ScrollPanel extends React.Component<IProps> {
721716
}
722717
}
723718

724-
private onUiResize = () => {
725-
this.setDataScrollbar();
726-
};
727-
728-
private setDataScrollbar(contentHeight = this.getMessagesHeight()) {
729-
const sn = this.getScrollNode();
730-
const minHeight = sn.clientHeight;
731-
const displayScrollbar = contentHeight > minHeight;
732-
sn.dataset.scrollbar = displayScrollbar.toString();
733-
}
734-
735719
// need a better name that also indicates this will change scrollTop? Rebalance height? Reveal content?
736720
private async updateHeight(): Promise<void> {
737721
// wait until user has stopped scrolling
@@ -753,7 +737,6 @@ export default class ScrollPanel extends React.Component<IProps> {
753737
const minHeight = sn.clientHeight;
754738
const height = Math.max(minHeight, contentHeight);
755739
this.pages = Math.ceil(height / PAGE_SIZE);
756-
this.setDataScrollbar(contentHeight);
757740
this.bottomGrowth = 0;
758741
const newHeight = `${this.getListHeight()}px`;
759742

0 commit comments

Comments
 (0)