question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to delete a word via Ctrl+Backspace in an empty TextField causes an exception

See original GitHub issue

I’ve built a minimal example: https://github.com/silenium-dev/bug-report-example

I’ll try to fix it myself and submit a pull request.

Stacktrace:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: offset(-1) is out of bounds [0, 0]
	at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:755)
	at androidx.compose.ui.text.MultiParagraph.getWordBoundary--jx7JFs(MultiParagraph.kt:589)
	at androidx.compose.ui.text.TextLayoutResult.getWordBoundary--jx7JFs(TextLayoutResult.kt:518)
	at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.getPrevWordOffset(TextPreparedSelection.kt:278)
	at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.getPrevWordOffset$default(TextPreparedSelection.kt:272)
	at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.getPreviousWordOffset(TextPreparedSelection.kt:198)
	at androidx.compose.foundation.text.TextFieldKeyInput$process$2$5.invoke(TextFieldKeyInput.kt:148)
	at androidx.compose.foundation.text.TextFieldKeyInput$process$2$5.invoke(TextFieldKeyInput.kt:147)
	at androidx.compose.foundation.text.selection.TextFieldPreparedSelection.deleteIfSelectedOr(TextPreparedSelection.kt:397)
	at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:147)
	at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:103)
	at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.kt:223)
	at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.kt:103)
	at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:255)
	at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:255)
	at androidx.compose.ui.input.key.KeyInputModifier.propagateKeyEvent-ZmokQxo(KeyInputModifier.kt:124)
	at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput-ZmokQxo(KeyInputModifier.kt:103)
	at androidx.compose.ui.platform.SkiaBasedOwner.sendKeyEvent-ZmokQxo(SkiaBasedOwner.skiko.kt:231)
	at androidx.compose.ui.ComposeScene.sendKeyEvent-ZmokQxo(ComposeScene.skiko.kt:572)
	at androidx.compose.ui.awt.ComposeLayer$onKeyEvent$1.invoke(ComposeLayer.desktop.kt:410)
	at androidx.compose.ui.awt.ComposeLayer$onKeyEvent$1.invoke(ComposeLayer.desktop.kt:406)
	at androidx.compose.ui.awt.ComposeLayer.catchExceptions(ComposeLayer.desktop.kt:109)
	at androidx.compose.ui.awt.ComposeLayer.onKeyEvent(ComposeLayer.desktop.kt:406)
	at androidx.compose.ui.awt.ComposeLayer.access$onKeyEvent(ComposeLayer.desktop.kt:87)
	at androidx.compose.ui.awt.ComposeLayer$7.keyPressed(ComposeLayer.desktop.kt:385)
	at java.desktop/java.awt.Component.processKeyEvent(Component.java:6584)
	at java.desktop/java.awt.Component.processEvent(Component.java:6403)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:883)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1150)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1020)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:848)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4882)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
eymarcommented, Nov 17, 2022

merged the fixed into JB fork for now. It has to be upstreamed.

1reaction
asaphacommented, Nov 16, 2022

There’s an existing issue on Google’s issue tracker by the way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Winforms Textbox - Using Ctrl-Backspace to Delete Whole Word
The problem with this is that the apperance of the RichTextBox (border in particular) is different from that of the TextBox, and I...
Read more >
1384. When I try to delete selected text by using BACKSPACE ...
When I try to delete selected text by using BACKSPACE in Microsoft Word, it doesn't work. From the File tab select the Options...
Read more >
Getting an Error when I use the Backspace to clear a textbox
Hey all,. When I test my code out, enter a number then backspace all the way back to the beginning i get an...
Read more >
Ctrl+Backspace inserts a small box instead of erasing
When I press Ctrl + Backspace , sometimes a small square is inserted, instead of the entire word being erased. The problem only...
Read more >
Xonsh Change Log - xonsh 0.13.2 documentation
Raising BaseException no longer causes Xonsh to crash (fix #4567) ... Add CTRL-Backspace key binding to delete a single word via $XONSH_CTRL_BKSPC_DELETION ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found