File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 242
242
"profile" : " http://www.nickrandall.com" ,
243
243
"contributions" : [
244
244
" review"
245
+ },
246
+ "login" : " CarsonF" ,
247
+ "name" : " Carson Full" ,
248
+ "avatar_url" : " https://avatars3.githubusercontent.com/u/932566?v=4" ,
249
+ "profile" : " https://github.com/CarsonF" ,
250
+ "contributions" : [
251
+ " code"
245
252
]
246
253
}
247
254
],
Original file line number Diff line number Diff line change @@ -668,6 +668,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
668
668
<td align="center"><a href="https://github.com/kevynb"><img src="https://avatars1.githubusercontent.com/u/4941215?v=4" width="100px;" alt="Kevyn Bruyere"/><br /><sub><b>Kevyn Bruyere</b></sub></a><br /><a href="https://github.com/express-labs/pure-react-carousel/commits?author=kevynb" title="Code">💻</a></td>
669
669
<td align="center"><a href="https://github.com/mariohoyos92"><img src="https://avatars1.githubusercontent.com/u/29843005?v=4" width="100px;" alt="Mario Hoyos"/><br /><sub><b>Mario Hoyos</b></sub></a><br /><a href="https://github.com/express-labs/pure-react-carousel/commits?author=mariohoyos92" title="Code">💻</a></td>
670
670
<td align="center"><a href="http://www.nickrandall.com"><img src="https://avatars1.githubusercontent.com/u/1800460?v=4" width="100px;" alt="Nick Randall"/><br /><sub><b>Nick Randall</b></sub></a><br /><a href="#review-nicksrandall" title="Reviewed Pull Requests">👀</a></td>
671
+ <td align="center"><a href="https://github.com/CarsonF"><img src="https://avatars3.githubusercontent.com/u/932566?v=4" width="100px;" alt="Carson Full"/><br /><sub><b>Carson Full</b></sub></a><br /><a href="https://github.com/express-labs/pure-react-carousel/commits?author=CarsonF" title="Code">💻</a></td>
671
672
</tr>
672
673
</table>
673
674
Original file line number Diff line number Diff line change @@ -613,8 +613,13 @@ const Slider = class Slider extends React.Component {
613
613
614
614
const newTabIndex = tabIndex !== null ? tabIndex : 0 ;
615
615
616
- // remove `dragStep` and `step` from Slider div, since it isn't a valid html attribute
617
- const { dragStep, step, ...rest } = props ;
616
+ // remove invalid div attributes
617
+ const {
618
+ dragStep,
619
+ step,
620
+ infinite,
621
+ ...rest
622
+ } = props ;
618
623
619
624
// filter out some tray props before passing them in. We will process event handlers in the
620
625
// trayProps object as callbacks to OUR event handlers. Ref is needed by us. Style and
Original file line number Diff line number Diff line change @@ -1047,5 +1047,13 @@ describe('<Slider />', () => {
1047
1047
instance . unlockScroll ( ) ;
1048
1048
expect ( instance . scrollParent ) . toEqual ( null ) ;
1049
1049
} ) ;
1050
+
1051
+ it ( 'should not pass invalid props to div' , ( ) => {
1052
+ const wrapper = shallow ( < Slider { ...props } /> ) ;
1053
+ const divProps = wrapper . closest ( 'div' ) . props ( ) ;
1054
+ expect ( divProps . dragStep ) . toBeUndefined ( ) ;
1055
+ expect ( divProps . step ) . toBeUndefined ( ) ;
1056
+ expect ( divProps . infinite ) . toBeUndefined ( ) ;
1057
+ } ) ;
1050
1058
} ) ;
1051
1059
} ) ;
You can’t perform that action at this time.
0 commit comments