You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uncaught (in promise) IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 28 is larger than the node's length (27).
at #createCloneRange
at InputRange.getBoundingClientRect
at TextExpander.positionMenu
at TextExpander.activate
at TextExpander.onInput
It seems that 2 bugs are related:
when provide a promise, after await Promise.all(providers), the textarea's content might have changed.
But activate and positionMenu still use old (outdated) match, then the position in const caretRect = new InputRange(this.input, position).getBoundingClientRect(); is invalid.
the query will return incorrect position for "multiword" when the last "key" is removed.
And delete the chars in the last line from the end, when the # in the last line is deleted, the JS error occurs. It's quite strange that it must have 3 lines to reproduce the bug.
The text was updated successfully, but these errors were encountered:
wxiaoguang
changed the title
positionMenu will cause JS promise error when provide uses promisepositionMenu will cause JS promise error when use multiword and promise for provideJan 25, 2025
Stacktrace:
It seems that 2 bugs are related:
provide
a promise, afterawait Promise.all(providers)
, the textarea's content might have changed.But
activate
andpositionMenu
still use old (outdated)match
, then theposition
inconst caretRect = new InputRange(this.input, position).getBoundingClientRect();
is invalid.query
will return incorrect position for "multiword" when the last "key" is removed.To reproduce:
Then use the textarea value:
And delete the chars in the last line from the end, when the
#
in the last line is deleted, the JS error occurs. It's quite strange that it must have 3 lines to reproduce the bug.The text was updated successfully, but these errors were encountered: