react-ace
react-ace copied to clipboard
onValidate causes docLines[endRow] to be undefined
I've got an editor component set up like the following:
const [value, setValue] = useState('')
const [valid, setValid] = useState(true)
return (
<AceEditor
mode="javascript"
theme="vibrant_ink"
value={value}
onChange={(val) => {
setValid(false)
setValue(val)
}}
onValidate={(a) => setValid(a.every(({type}) => type !== 'error'))}
/>
)
Typing the code
const a = 3
console.dir(a)
into the editor produces the following error in the console and causes the validation to break:
Object { message: "TypeError: docLines[endRow] is undefined", data: undefined, file: "blob:http://localhost:3000/55b4663e-18c3-7a41-9756-de9ab36d6084", line: 1, col: 0, stack: "exports.applyDelta@blob:http://localhost:3000/55b4663e-18c3-7a41-9756-de9ab36d6084:1:9527\nthis.applyDelta@blob:http://localhost:3000/55b4663e-18c3-7a41-9756-de9ab36d6084:1:21858\nexports.Mirror/<@blob:http://localhost:3000/55b4663e-18c3-7a41-9756-de9ab36d6084:1:26686\nEventEmitter._signal@blob:http://localhost:3000/55b4663e-18c3-7a41-9756-de9ab36d6084:1:10664\nwindow.onmessage@blob:http://localhost:3000/55b4663e-18c3-7a41-9756-de9ab36d6084:1:3535\n" }
index.js:1437
hi @DeedleFake , I'm facing same issue, do u have any solution?
Sadly, not that I've found. Haven't looked at it in a while, though.
@securingsincity Any progress on this issue? I've been experiencing the exact same issue as @DeedleFake, except without any validation.
For me, this is happening with mode="json"
, but I haven't tried with other modes.