fix: Create an ElementInput in Application - #353
Open
willeastcott wants to merge 1 commit into
Open
willeastcott wants to merge 1 commit into
willeastcott wants to merge 1 commit into
Conversation
<Application> created the mouse and touch devices but no ElementInput, the object that turns input into events on element components. Without it, elements with useInput received no events, buttons never reacted, and scroll views and scrollbars could not be dragged. The debug engine only warns about it. Create one when the application is created, before the mouse and touch devices, so its listeners run first and stopPropagation() in a UI event handler also keeps the event from app.mouse and app.touch. The test setup's mock Application now passes the element input through, so the new test can check it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 503f52e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<Application>creates the mouse and touch devices but noElementInput, the object that turns input into events on element components. Without it,<Element useInput>receives no events, buttons added to elements never react, and scroll views and scrollbars can't be dragged. The engine only reports it through a debug-build warning, so in a production build the UI is silently inert.This creates one when the application is created. It is created before the mouse and touch devices, so its window listeners run first: calling
stopPropagation()in a UI event handler then also keeps the event fromapp.mouseandapp.touch(for example,app.mouse.wasPressed()stays false for a click on a button), which is the order the Editor's launcher uses.Checked in Chrome with engine 2.22.4: with no other setup, a button's
click, an element'sclickandmousedownfire, andstopPropagation()onmousedownkeepsapp.mouse.wasPressed()false, in StrictMode too.<Entity onClick>picking still works alongside it.The test setup's mock
Applicationnow passes theelementInputoption through, so a new test can check that the application has one and that it is bound to the app. A changeset is included (patch).Found while rewriting the User Interface chapter of the User Manual; its React examples would otherwise need a wrapper component that creates the
ElementInputand re-attaches the mouse and touch devices.🤖 Generated with Claude Code