Selaa lähdekoodia

Merge pull request #98012 from syntaxerror247/lineEdit-bug-fix

Fix uneditable `LineEdit`, `TextEdit` and `CodeEdit` virtual keyboard popup on mobile
Thaddeus Crews 8 kuukautta sitten
vanhempi
commit
70ea5713cf
2 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 3 1
      scene/gui/line_edit.cpp
  2. 6 2
      scene/gui/text_edit.cpp

+ 3 - 1
scene/gui/line_edit.cpp

@@ -550,7 +550,9 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
 				pending_select_all_on_focus = false;
 			}
 
-			show_virtual_keyboard();
+			if (editable) {
+				show_virtual_keyboard();
+			}
 		}
 
 		queue_redraw();

+ 6 - 2
scene/gui/text_edit.cpp

@@ -1605,7 +1605,9 @@ void TextEdit::_notification(int p_what) {
 				draw_caret = true;
 			}
 
-			_show_virtual_keyboard();
+			if (editable) {
+				_show_virtual_keyboard();
+			}
 		} break;
 
 		case NOTIFICATION_FOCUS_EXIT: {
@@ -2008,7 +2010,9 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
 				}
 			}
 
-			_show_virtual_keyboard();
+			if (editable) {
+				_show_virtual_keyboard();
+			}
 		}
 	}