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: type when element.maxLength is -1 #263

Merged
merged 1 commit into from May 8, 2020
Merged

fix: type when element.maxLength is -1 #263

merged 1 commit into from May 8, 2020

Conversation

pomber
Copy link
Contributor

@pomber pomber commented May 8, 2020

I'm using user-event in the browser, not sure if it's officially supported but it mostly works.

There's a problem with type, it's removing the last char from the text because the browser returns -1 from element.maxLength. I changed it to only slice with maxLength when it's a positive number.

@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #263 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #263   +/-   ##
=======================================
  Coverage   98.75%   98.75%           
=======================================
  Files           1        1           
  Lines         160      160           
  Branches       44       44           
=======================================
  Hits          158      158           
  Misses          2        2           
Impacted Files Coverage Δ
src/index.js 98.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f15bec6...36a62ec. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Solid. This definitely should work in the browser so thank you for this 👍

@kentcdodds kentcdodds merged commit 2a3d774 into testing-library:master May 8, 2020
@kentcdodds
Copy link
Member

@all-contributors please add @pomber for code

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @pomber! 🎉

@Gpx
Copy link
Member

Gpx commented May 8, 2020

🎉 This PR is included in version 10.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants