Skip to content

Commit

Permalink
Ignore selection range update when the element is not focused.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnCZek committed Nov 25, 2023
1 parent f6d2e78 commit 90756db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/Core/Elements/WidgetTextInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 90756db

Please sign in to comment.