mirror of
https://github.com/codex-team/editor.js
synced 2024-06-01 21:42:26 +02:00
changes for error handling
This commit is contained in:
parent
bb006cd2aa
commit
c5f579e714
|
@ -60,7 +60,7 @@ export default class Caret extends Module {
|
|||
|
||||
/** In case lastNode is native input */
|
||||
if ($.isNativeInput(firstNode)) {
|
||||
return (firstNode as HTMLInputElement).selectionEnd === 0;
|
||||
return (firstNode as HTMLInputElement)?.selectionEnd === 0;
|
||||
}
|
||||
|
||||
/** Case when selection have been cleared programmatically, for example after CBS */
|
||||
|
@ -162,7 +162,7 @@ export default class Caret extends Module {
|
|||
|
||||
/** In case lastNode is native input */
|
||||
if ($.isNativeInput(lastNode)) {
|
||||
return (lastNode as HTMLInputElement).selectionEnd === (lastNode as HTMLInputElement).value.length;
|
||||
return (lastNode as HTMLInputElement)?.selectionEnd === (lastNode as HTMLInputElement).value.length;
|
||||
}
|
||||
|
||||
/** Case when selection have been cleared programmatically, for example after CBS */
|
||||
|
|
Loading…
Reference in a new issue