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

Commit

Permalink
fix: if disabled return wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
wwayne committed Jun 10, 2021
1 parent c36c3bb commit 0eb0205
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,14 @@ export default class HorizontalScroll extends Component {
const { className, children, disabled } = this.props
const { trackWidth } = this.state
const isArrayChild = Array.isArray(children)
if (disabled) return children
if (disabled) {
return (
<div className={className}>
{children}
</div>
)
}

return (
<div className={`HorizontalScroll ${className || ''}`} ref={this.wrapperRef}>
<div className='HorizontalScrollOuter' id={this.outerId} onWheel={::this.onWheel}>
Expand Down

0 comments on commit 0eb0205

Please sign in to comment.