Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dfdafba

Browse filesBrowse files
committed
Fix DTextEntry autocomplete
1 parent ece6063 commit dfdafba
Copy full SHA for dfdafba

File tree

Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed

‎garrysmod/lua/vgui/dtextentry.lua

Copy file name to clipboardExpand all lines: garrysmod/lua/vgui/dtextentry.lua
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,11 @@ derma.DefineControl( "DTextEntry", "A simple TextEntry control", PANEL, "TextEnt
417417
-----------------------------------------------------------]]
418418
function TextEntryLoseFocus( panel, mcode )
419419

420-
local pnl = vgui.GetKeyboardFocus()
421-
if ( !pnl ) then return end
422-
if ( pnl == panel ) then return end
423-
if ( !pnl.m_bLoseFocusOnClickAway ) then return end
420+
local textArea = vgui.GetKeyboardFocus()
421+
if ( !textArea ) then return end
422+
if ( textArea == panel ) then return end
423+
if ( textArea:IsOurChild( panel ) ) then return end -- Do not lose focus when clicking panels parented to the text entry (Autocomplete DMenu)
424+
if ( !textArea.m_bLoseFocusOnClickAway ) then return end
424425

425426
-- We gotta find the EdtiablePanel parent and call KillFocus on it
426427
-- We do it from the panel clicked, not the KB focus, which is necessary for DTextEntry autocomplete to not break

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.