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

Commit

Permalink
Remove data-scrollbar workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Apr 22, 2022
1 parent 763edb7 commit 85b7be7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
4 changes: 0 additions & 4 deletions res/css/structures/_RoomView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ limitations under the License.
overflow-y: auto;
flex: 1 1 0;
overflow-anchor: none;

&[data-scrollbar=false] {
overflow-y: hidden;
}
}

.mx_RoomView_messagePanelSearchSpinner {
Expand Down
17 changes: 0 additions & 17 deletions src/components/structures/ScrollPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import AutoHideScrollbar from "./AutoHideScrollbar";
import { getKeyBindingsManager } from "../../KeyBindingsManager";
import ResizeNotifier from "../../utils/ResizeNotifier";
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
import UIStore, { UI_EVENTS } from "../../stores/UIStore";

const DEBUG_SCROLL = false;

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

componentDidMount() {
this.checkScroll();

UIStore.instance.on(UI_EVENTS.Resize, this.onUiResize);
}

componentDidUpdate() {
Expand All @@ -233,8 +230,6 @@ export default class ScrollPanel extends React.Component<IProps> {
if (this.props.resizeNotifier) {
this.props.resizeNotifier.removeListener("middlePanelResizedNoisy", this.onResize);
}

UIStore.instance.off(UI_EVENTS.Resize, this.onUiResize);
}

private onScroll = ev => {
Expand Down Expand Up @@ -721,17 +716,6 @@ export default class ScrollPanel extends React.Component<IProps> {
}
}

private onUiResize = () => {
this.setDataScrollbar();
};

private setDataScrollbar(contentHeight = this.getMessagesHeight()) {
const sn = this.getScrollNode();
const minHeight = sn.clientHeight;
const displayScrollbar = contentHeight > minHeight;
sn.dataset.scrollbar = displayScrollbar.toString();
}

// need a better name that also indicates this will change scrollTop? Rebalance height? Reveal content?
private async updateHeight(): Promise<void> {
// wait until user has stopped scrolling
Expand All @@ -753,7 +737,6 @@ export default class ScrollPanel extends React.Component<IProps> {
const minHeight = sn.clientHeight;
const height = Math.max(minHeight, contentHeight);
this.pages = Math.ceil(height / PAGE_SIZE);
this.setDataScrollbar(contentHeight);
this.bottomGrowth = 0;
const newHeight = `${this.getListHeight()}px`;

Expand Down

0 comments on commit 85b7be7

Please sign in to comment.