Skip to content

Commit cab4849

Browse files
committed
Fix double text_changed signal when overwriting selection in LineEdit
The part of gui_input that handles unicode wasn't checking text_changed_dirty before emitting the signal, unlike the rest of the text editing functions. Fixes #86451
1 parent 13a0d6e commit cab4849

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scene/gui/line_edit.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,12 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
624624
int prev_len = text.length();
625625
insert_text_at_caret(ucodestr);
626626
if (text.length() != prev_len) {
627-
_text_changed();
627+
if (!text_changed_dirty) {
628+
if (is_inside_tree()) {
629+
callable_mp(this, &LineEdit::_text_changed).call_deferred();
630+
}
631+
text_changed_dirty = true;
632+
}
628633
}
629634
accept_event();
630635
return;

0 commit comments

Comments
 (0)