2
0
Эх сурвалжийг харах

Focus the document when shown, not input elements. Allow tabbing when document is in focus.

Michael Ragazzon 6 жил өмнө
parent
commit
c3d9cff00e

+ 3 - 6
Source/Core/ElementDocument.cpp

@@ -228,11 +228,8 @@ void ElementDocument::Show(int focus_flags)
 
 	if (focus_flags & FOCUS || focus_flags & MODAL)
 	{
-		// If no element could be focused, focus the window
-		if (!FocusNextTabElement(this, true))
-		{
-			Focus();
-		}
+		// Focus the window when shown
+		Focus();
 	}
 
 	DispatchEvent(EventId::Show, Dictionary());
@@ -410,7 +407,7 @@ void ElementDocument::ProcessDefaultAction(Event& event)
 	Element::ProcessDefaultAction(event);
 
 	// Process generic keyboard events for this window in bubble phase
-	if (event.GetPhase() == EventPhase::Bubble && event == EventId::Keydown)
+	if (event == EventId::Keydown)
 	{
 		int key_identifier = event.GetParameter<int>("key_identifier", Input::KI_UNKNOWN);