cleave.js
cleave.js copied to clipboard
rename rawValue since chrome experiments are setting this to readonly
Fixes #593 (sorta)
Chrome's "Experimental Web Platform Features" flag is setting rawValue
on these events to readonly
, causing errors with Cleave.js when users have this enabled.
I don't think this is the complete solution, because I'm sure there are people out there reading / interacting with the rawValue
attribute that is being set here. This would require a major version upgrade on Cleave.js's part. Our project does not need this property, though, so I wanted to share this solution with others. Renaming it gets around the issues seen in Chrome in #593 .
I also could not run the tests to see what else might need to be worked on here, because the fsevents
dependency seems to be really outdated. Again, my goal was mostly to stop the errors our users were seeing, and to share the solution.
(note I could also not run gulp build
etc because of the aforementioned issue re: installing the dependencies for this library, so the minified files aren't changed etc)
bump
Is this going to be merged at some point, as it's causing issues in latest Chrome?
@Wildhoney if you want, I have the fix for this and #601 in a fork, which is meant to be a temporary workaround while this package is hopefully fixed. Reposting the instructions for you & others, if you want a fix and don't need the rawValue
functionality. It has been stable for the last couple weeks in my project.
There'd be more work than just merging this PR since I wasn't able to run the build process locally. So minified files and whatnot weren't changed. The NPM dependencies here are really old and fail to download. But you don't need all of that if you're adding the package via NPM or Yarn.
To add the fork in your package.json
dependencies, for example:
"cleave.js": "https://github.com/MercuryTechnologies/cleave.js.git#rawValueFix1.4.10",
This fork reverts cleave.js
to 1.4.10
- which fixes #601 - and also applies a patch to rename rawValue
to cleaveRawValue
We'll see if the live version gets a fix, but until then, hope that helps!
Note : this also seems to fix this bug of right-click pasting into an empty input. I couldn't build from sources either. Thanks @ekilah for the temporary fix !
nvm use 8
works btw guys for test running and building.
This breaks the Tempurpedic order form which uses cleave. An upstreamed fix is pretty important before Chrome rolls out in stable, who knows how many other sites are relying on it. I thought it was their site until I saw cleave in the devtools.
(Just sharing impact in production cases)
Hey @nosir, Should we merge this PR ? It's still impacting a lot of websites using Cleave 😞 Thanks 🙏🏻
Details here, but it looks like this issue is no longer caused by Cleave, because Chrome's experiment ended with the change to rawValue
:
https://github.com/nosir/cleave.js/issues/593#issuecomment-1507157493