Skip to content

Commit

Permalink
fix console completion selection on HTML5 (#3225)
Browse files Browse the repository at this point in the history
* fix completion selection on HTML

revert formatting

* remove trailing whitespace

* Update flixel/system/debug/console/Console.hx

---------

Co-authored-by: George Kurelic <[email protected]>
  • Loading branch information
ninjamuffin99 and Geokureli authored Aug 14, 2024
1 parent a52272d commit 9954eb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions flixel/system/debug/completion/CompletionList.hx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class CompletionList extends Sprite
createPopupEntries(capacity);
createScrollBar();
updateSelectedItem();

FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
}

public function show(x:Float, items:Array<String>)
Expand Down Expand Up @@ -82,7 +80,7 @@ class CompletionList extends Sprite
addChild(scrollBar);
}

function onKeyDown(e:KeyboardEvent)
public function onKeyDown(e:KeyboardEvent)
{
if (!visible)
return;
Expand Down
4 changes: 4 additions & 0 deletions flixel/system/debug/console/Console.hx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ class Console extends Window
function onKeyDown(e:KeyboardEvent)
{
if (completionList.visible)
{
// Fixes issue with listening for key down events - https://github.com/HaxeFlixel/flixel/pull/3225
completionList.onKeyDown(e);
return;
}

switch (e.keyCode)
{
Expand Down

0 comments on commit 9954eb5

Please sign in to comment.