cleave.js icon indicating copy to clipboard operation
cleave.js copied to clipboard

input.rawValue might be read-only

Open donysukardi opened this issue 5 years ago • 4 comments

Chrome has intent to ship feature that adds .rawValue attribute. More details can be found here: https://www.chromestatus.com/feature/5986951683375104.

It's currently already available behind web experimental flags on latest Chrome. Using React version of cleave.js now throws the following error onFocus and onBlur

Uncaught TypeError: Cannot assign to read only property 'rawValue' of object '#<HTMLInputElement>'

donysukardi avatar Jun 01 '20 02:06 donysukardi

I am also seeing a few users of my application run into this error, though I hadn't figured out how to reproduce it yet.

TypeError Cannot assign to read only property 'rawValue' of object '#<HTMLInputElement>' 
    ../node_modules/cleave.js/dist/cleave-react-node.js:325 Object.onBlur
    ../node_modules/react-dom/cjs/react-dom.production.min.js:15:202 Object.i
    ../node_modules/react-dom/cjs/react-dom.production.min.js:15:355 qa
    ../node_modules/react-dom/cjs/react-dom.production.min.js:16:31 ra
    ../node_modules/react-dom/cjs/react-dom.production.min.js:16:235 wa
    ../node_modules/react-dom/cjs/react-dom.production.min.js:17:239 Aa
    ../node_modules/react-dom/cjs/react-dom.production.min.js:17:19 ya
    ../node_modules/react-dom/cjs/react-dom.production.min.js:17:411 Ba
    ../node_modules/react-dom/cjs/react-dom.production.min.js:85:402 Pd
    ../node_modules/react-dom/cjs/react-dom.production.min.js:87:246 Ud

This started in Chrome 83.0.4103 in my error reports, and has also been seen since in 84 and 85 a few times. Currently only on Mac OSX but the sample size is too low to know if other platforms' Chrome installs have this also, and I haven't tested it.

ekilah avatar Jun 05 '20 06:06 ekilah

@ekilah you need to enable Experimental Web Platform Features on chrome://flags on the latest Chrome

donysukardi avatar Jun 05 '20 08:06 donysukardi

@donysukardi I have forked & fixed this for myself for now, see #600 . Feel free to use this fork if it works for you, though I don't intend to maintain it much past sharing the solution here.

ekilah avatar Jun 16 '20 00:06 ekilah

Update for anyone subscribed here, I just happened upon this and it looks like the experiment is no longer being pursued by the Chrome team, so this issue shouldn't occur anymore.

https://chromestatus.com/feature/5986951683375104

image

ekilah avatar Apr 13 '23 15:04 ekilah