🎨 Palette: Prevent page scrolling when playing Mario game#110
🎨 Palette: Prevent page scrolling when playing Mario game#110
Conversation
Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What
Updated the
mario-game.njkview to calle.preventDefault()on game-related keypresses (Space, Arrow keys). I also restricted the jump action to specifically "Space" or "ArrowUp", rather than any keypress.🎯 Why
Browsers natively interpret Space and Arrow keys as commands to scroll the page. When playing a browser-based game, this creates a frustrating user experience where the entire game container jumps up and down while the user is trying to play. Additionally, jumping when a user pressed an unrelated key (like 'A' or 'Shift') felt unpolished.
📸 Before/After
(Visuals remain identical, interaction is what changed.)
♿ Accessibility
Keyboard players can now reliably use the game without interfering with their broader browser viewport or triggering unintended page navigation.
PR created automatically by Jules for task 5245249649879977107 started by @EiJackGH