diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt index b7f42f508..be3c62cde 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt @@ -1118,15 +1118,25 @@ open class EditablePanel @JvmOverloads constructor( if (isFocused) { isFocused = false } + + grabMouseInput = false + } + + private fun killGrabMouseInput() { + for (child in childrenInternal) { + child.killGrabMouseInput() + } + + grabMouseInput = false } fun killFocus() { if (isEverFocused()) { killFocusInternal() findAbsoluteRoot().updateFocus() + } else if (isGrabbingMouseInput()) { + killGrabMouseInput() } - - grabMouseInput = false } fun findHierarchicalFocus(): EditablePanel<*>? { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/input/TextInputPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/input/TextInputPanel.kt index 6a1d94d43..e656c59ab 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/input/TextInputPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/input/TextInputPanel.kt @@ -1156,7 +1156,7 @@ open class TextInputPanel( cursorCharacter = pos.x isSelecting = true - grabMouseInput = true + tryToGrabMouseInput() } return true