cleave.js
cleave.js copied to clipboard
Uncaught TypeError: Cannot read properties of undefined (reading 'activeElement')
When migrate to Vite 4, I'm getting this error :
Uncaught TypeError: Cannot read properties of undefined (reading 'activeElement')
at Object.getActiveElement (cleave-react-node.js:2766:37)
at Object.setSelection (cleave-react-node.js:2741:31)
at ReactClassComponent.componentDidUpdate (cleave-react-node.js:103:15)
at commitLifeCycles (react-dom.development.js:20684:24)
at commitLayoutEffects (react-dom.development.js:23426:7)
at HTMLUnknownElement.callCallback2 (react-dom.development.js:3945:14)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:16)
at invokeGuardedCallback (react-dom.development.js:4056:31)
at commitRootImpl (react-dom.development.js:23151:9)
at unstable_runWithPriority (scheduler.development.js:468:12)
I'm using the lib correctly 'cause it worked with CRA.
This code from this cleave-react-node
seems involved :
getActiveElement: function getActiveElement(parent) {
var activeElement = parent.activeElement;
if (activeElement && activeElement.shadowRoot) {
return this.getActiveElement(activeElement.shadowRoot);
}
return activeElement;
}
Do you have any idea what I can do ?
@RuellePaul did you ever find a solution for this? running into the same problem.
@RuellePaul did you ever find a solution for this? running into the same problem.
I changed for another library 😄
@RuellePaul which library?