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

Fix localizednumber test. Overwrite the existing value rather than appending text #2093

merged 1 commit into from Feb 21, 2017


Copy link

@whawker whawker commented Oct 5, 2016

This test was always returning false even when the browser and OS were in a Spanish locale.

You can see this for yourself by changing Chrome's default language to Spanish, and loading the Modernizr test page.

The initial value of the input box is 1,0 - when we document.execCommand('InsertText', false, '1,1') it was prepending to the start of the input value resulting in 111,0.

By executing document.execCommand('SelectAll', false) first, we ensure we overwrite the current input value, and the test passes.

@ryanseddon ryanseddon merged commit 6c4d87c into Modernizr:master Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants