File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-card-scroll" ,
3- "version" : " 2.0.0 " ,
3+ "version" : " 2.0.1 " ,
44 "description" : " A React component to navigate horizontally between cards of same width" ,
55 "main" : " lib/index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -71,13 +71,13 @@ let CardScroll = React.createClass({
7171 let first = true
7272 return (
7373 < div >
74- { this . canScrollLeft ( ) ?
74+ { this . showArrows ( ) && this . canScrollLeft ( ) ?
7575 < div className = { s . leftArrow }
7676 onClick = { this . scrollCardsWrap ( { toLeft : true } ) } >
7777 < div className = { s . arrow } > </ div >
7878 </ div >
7979 :null }
80- { this . canScrollRight ( ) ?
80+ { this . showArrows ( ) && this . canScrollRight ( ) ?
8181 < div className = { s . rightArrow }
8282 onClick = { this . scrollCardsWrap ( ) } >
8383 < div className = { s . arrow } > </ div >
@@ -153,11 +153,15 @@ let CardScroll = React.createClass({
153153 } ,
154154
155155 canScrollRight ( ) {
156- return this . props . showArrows && this . lastVisibleCardIndex ( ) + 1 < React . Children . count ( this . props . children )
156+ return this . lastVisibleCardIndex ( ) + 1 < React . Children . count ( this . props . children )
157157 } ,
158158
159159 canScrollLeft ( ) {
160- return this . props . showArrows && this . state . currentCard > 0
160+ return this . state . currentCard > 0
161+ } ,
162+
163+ showArrows ( ) {
164+ return this . props . showArrows
161165 } ,
162166
163167 /**
You can’t perform that action at this time.
0 commit comments