Skip to content

Commit

Permalink
Merge pull request #86460 from reach-satori/double_textchanged_emit
Browse files Browse the repository at this point in the history
Fix double `text_changed` signal when overwriting selection in LineEdit
  • Loading branch information
akien-mga committed Jan 3, 2024
2 parents 27a9119 + cab4849 commit 5042f54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,12 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
int prev_len = text.length();
insert_text_at_caret(ucodestr);
if (text.length() != prev_len) {
_text_changed();
if (!text_changed_dirty) {
if (is_inside_tree()) {
callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
}
accept_event();
return;
Expand Down

0 comments on commit 5042f54

Please sign in to comment.