Skip to content

Use optional chaining to prevent button reference error. #997

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

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

microbit-robert
Copy link
Collaborator

This is a logged bug that appears to occur after sending a gesture to the simulator and then expand/collapsing the accelerometer module panel. This causes a re-render and the gesture button ref can be undefined. We should also not change the focus if the user's last action was to expand/collapse the module, so this seems a reasonable fix.

@github-actions
Copy link

Preview build will be at
https://review-python-editor-v3.microbit.org/sim-ref-issue/

@microbit-matt-hillsdon
Copy link
Collaborator

We can definitely merge this, but perhaps we shouldn't disable the button at all? E.g. a quick enter, tab is quite confusing. I'm assuming disabling the button is what's preventing focus staying on it. Feels like it needs some kind of reaction though.

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 5b16ce9 into main Sep 26, 2022
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the sim-ref-issue branch September 26, 2022 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants