diff --git a/Source/Core/Elements/WidgetTextInput.cpp b/Source/Core/Elements/WidgetTextInput.cpp index 80b25fa61..04d818b2f 100644 --- a/Source/Core/Elements/WidgetTextInput.cpp +++ b/Source/Core/Elements/WidgetTextInput.cpp @@ -246,6 +246,9 @@ void WidgetTextInput::Select() void WidgetTextInput::SetSelectionRange(int selection_start, int selection_end) { + if (parent->GetContext()->GetFocusElement() != parent) + return; + const String& value = GetValue(); const int byte_start = ConvertCharacterOffsetToByteOffset(value, selection_start); const int byte_end = ConvertCharacterOffsetToByteOffset(value, selection_end);