Skip to content
Open
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
13 changes: 8 additions & 5 deletions packages/rax-recyclerview/src/VirtualizedList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ export default class VirtualizedList extends BaseList {

let showsScrollIndicator = horizontal ? showsHorizontalScrollIndicator : showsVerticalScrollIndicator;

if (!showsScrollIndicator && typeof document !== 'undefined' && !document.getElementById(STYLE_NODE_ID)) {
let styleNode = document.createElement('style');
styleNode.id = STYLE_NODE_ID;
document.head.appendChild(styleNode);
styleNode.innerHTML = `.${this.props.className}::-webkit-scrollbar{display: none;}`;
if (!showsScrollIndicator) {
wrapperStyle.scrollbarWidth = 'none';
if (typeof document !== 'undefined' && !document.getElementById(STYLE_NODE_ID)) {
let styleNode = document.createElement('style');
styleNode.id = STYLE_NODE_ID;
document.head.appendChild(styleNode);
styleNode.innerHTML = `.${this.props.className}::-webkit-scrollbar{display: none;}`;
}
}

// return children when has nested list
Expand Down
22 changes: 12 additions & 10 deletions packages/rax-scrollview/src/web/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,18 @@ const ScrollView: ForwardRefExoticComponent<ScrollViewProps> = forwardRef(
? showsHorizontalScrollIndicator
: showsVerticalScrollIndicator;
{
if (
!showsScrollIndicator &&
typeof document !== 'undefined' &&
typeof document.getElementById === 'function' &&
!document.getElementById(STYLE_NODE_ID)
) {
let styleNode = document.createElement('style');
styleNode.id = STYLE_NODE_ID;
document.head.appendChild(styleNode);
styleNode.innerHTML = `.${baseCls}::-webkit-scrollbar{display: none;}`;
if (!showsScrollIndicator) {
scrollerStyle.scrollbarWidth = 'none';
if (
typeof document !== 'undefined' &&
typeof document.getElementById === 'function' &&
!document.getElementById(STYLE_NODE_ID)
) {
let styleNode = document.createElement('style');
styleNode.id = STYLE_NODE_ID;
document.head.appendChild(styleNode);
styleNode.innerHTML = `.${baseCls}::-webkit-scrollbar{display: none;}`;
}
}

scrollerStyle.WebkitOverflowScrolling = 'touch';
Expand Down