Fix mouse input to examples in how-tos#1110
Merged
Merged
Conversation
amyjko
approved these changes
May 11, 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.
Context
For the following code, when rendered as an Example in a how-to:
The mouse input does not work -- it always moves the 👧 character downwards instead of in the direction that the mouse is relative to the 👧 glyph. However, the arrow keys work, and both mouse and arrow keys work in the Stage in the project editor.
I used Claude Code to debug and fix this issue. According to Claude, the issue is that if there are multiple OutputView components on the same page (e.g., multiple examples, as was the case in Adrienne's how-to), the listener for the pointer down event would have selected the first OutputView on the page and calculated where the 👧 character should move to according to that first OutputView, which is not necessarily the OutputView that the user is interacting with. I verified this hypothesis by pasting the above code by itself into a how-to and verified that the mouse interaction works as expected. But, when this code is pasted twice into two different examples (i.e.,
\code here\ \code here again\), the interaction only works in the first example.Related issues
Verification
Checklist