Skip to content

Commit ebbf3b3

Browse files
committed
Fixed input field not unfocusing when the dev console window is closed.
1 parent a18325b commit ebbf3b3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Changed enum command parameter to support namespaces to distinguish between enums with same names.
1111
- Fixed strings being displayed incorrectly by cs_evaluate.
1212
- Fixed issue with cached enum types.
13+
- Fixed input field not unfocusing when the developer console window is closed.
1314

1415
## [0.2.2-alpha] - 2021-08-20
1516
- Added real-time parameter information when typing out a command.

Runtime/DevConsoleMono.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ internal void CloseConsole()
584584
ConsoleIsShowing = false;
585585
_repositioning = false;
586586
_resizing = false;
587+
_focusInputField = false;
588+
if (_inputField.isFocused && EventSystem.current != null)
589+
{
590+
EventSystem.current.SetSelectedGameObject(null);
591+
}
587592

588593
DevConsole.InvokeOnConsoleClosed();
589594
}
@@ -949,6 +954,12 @@ internal char OnValidateInput(string _, int __, char addedChar)
949954
{
950955
const char EmptyChar = '\0';
951956

957+
// Ignore inputs if the dev console window is closed
958+
if (!ConsoleIsShowing)
959+
{
960+
return EmptyChar;
961+
}
962+
952963
// If a new line character is entered, submit the command
953964
if (addedChar == '\n')
954965
{

0 commit comments

Comments
 (0)