Skip to content

Commit 8fb2672

Browse files
authored
Merge branch 'master' into all-contributors/add-nicksrandall
2 parents e196fb2 + c3826be commit 8fb2672

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

.all-contributorsrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@
242242
"profile": "http://www.nickrandall.com",
243243
"contributions": [
244244
"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"
245252
]
246253
}
247254
],

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
668668
<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>
669669
<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>
670670
<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>
671672
</tr>
672673
</table>
673674

src/Slider/Slider.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,13 @@ const Slider = class Slider extends React.Component {
613613

614614
const newTabIndex = tabIndex !== null ? tabIndex : 0;
615615

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;
618623

619624
// filter out some tray props before passing them in. We will process event handlers in the
620625
// trayProps object as callbacks to OUR event handlers. Ref is needed by us. Style and

src/Slider/__tests__/Slider.test.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,5 +1047,13 @@ describe('<Slider />', () => {
10471047
instance.unlockScroll();
10481048
expect(instance.scrollParent).toEqual(null);
10491049
});
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+
});
10501058
});
10511059
});

0 commit comments

Comments
 (0)