I haven't set selection in my code, I don't know why it's causing this error, it could also be a browser bug, but it looks like you can avoid a component crash by simply checking the selectionStart.
To Reproduce
I only have the bug report, not the actual reproduction.
Expected behavior
Check the parameters, or catch an error so that the component does not crash.
Platform:
Safari 17.5
Chrome 128.0
Additional context
Add any other context about the problem here.
Describe the bug Sometimes the library will throw
IndexSizeError
.Here's where the error occurred https://github.com/inokawa/rich-textarea/blob/main/src/vendor/range-at-index.js#L47
Called by https://github.com/inokawa/rich-textarea/blob/main/src/input.tsx#L270 and https://github.com/inokawa/rich-textarea/blob/main/src/textarea.tsx#L247
I haven't set selection in my code, I don't know why it's causing this error, it could also be a browser bug, but it looks like you can avoid a component crash by simply checking the
selectionStart
.To Reproduce I only have the bug report, not the actual reproduction.
Expected behavior Check the parameters, or catch an error so that the component does not crash.
Platform:
Additional context Add any other context about the problem here.