diff --git a/res/css/structures/_RoomView.scss b/res/css/structures/_RoomView.scss index d7e31e618d..a3beb2dd69 100644 --- a/res/css/structures/_RoomView.scss +++ b/res/css/structures/_RoomView.scss @@ -120,6 +120,10 @@ limitations under the License. overflow-y: auto; flex: 1 1 0; overflow-anchor: none; + + &[data-scrollbar=false] { + overflow-y: hidden; + } } .mx_RoomView_messagePanelSearchSpinner { diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 1699b535d9..103796122f 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -750,6 +750,8 @@ export default class ScrollPanel extends React.Component { const minHeight = sn.clientHeight; const height = Math.max(minHeight, contentHeight); this.pages = Math.ceil(height / PAGE_SIZE); + const displayScrollbar = contentHeight > minHeight; + sn.dataset.scrollbar = displayScrollbar.toString(); this.bottomGrowth = 0; const newHeight = `${this.getListHeight()}px`;