Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix console completion selection on HTML5 #3225

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

ninjamuffin99
Copy link
Member

On HTML5, FlxG.stage.addEventListener seems to not properly do the keyboard events for the CompletionList.

This PR changes it so that onKeyDown is passed through from the debug consoles input event listeners, so using the arrow keys to move through the completions now works on HTML5 properly

@@ -37,8 +36,6 @@ class CompletionList extends Sprite
createPopupEntries(capacity);
createScrollBar();
updateSelectedItem();

FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this wasn't working? Is this a preventDefault issue? or is the console blocking these events somehow?

Copy link
Member Author

@ninjamuffin99 ninjamuffin99 Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure, I believe it's not console or FlxG.stage specific, since Lib.current.addEventListener also doesn't register tab key, and also the autofocus event listener doesn't work either ("Press TAB to focus the console!") in HTML5. It could be a preventDefault thing!

@Geokureli Geokureli merged commit 9954eb5 into HaxeFlixel:dev Aug 14, 2024
10 of 11 checks passed
@Geokureli
Copy link
Member

Thanks, if we figure out what's blocking events we can revisit this

@Geokureli Geokureli added this to the 5.9.0 milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants