Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use indexOf instead of includes in RangeKeyboardFixture #11133

Merged
merged 1 commit into from Oct 6, 2017

Conversation

nhunzaker
Copy link
Contributor

@nhunzaker nhunzaker commented Oct 6, 2017

Older browsers don't have [].includes. I thought about adding the polyfill, but indexOf is simple enough.

This allows us to test the range input change event test fixture in IE10-11 and older Chrome/Safari/Firefox.

Fixes #11132

Allows the DOM Fixture change test case to work in older browsers.
if (![37, 38, 39, 40].includes(e.keyCode)) return;
if ([37, 38, 39, 40].indexOf(e.keyCode) < 0) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter was fussing at me about no curlies after the if, so I threw em in.

@reactjs-bot
Copy link

Deploy preview ready!

Built with commit f322b5c

https://deploy-preview-11133--reactjs.netlify.com

@nhunzaker nhunzaker merged commit ea507f1 into facebook:master Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOM Test Fixtures: Unable to Load React 16
4 participants