microbit-foundation / python-editor-v3

Micro:bit Educational Foundation Python Editor V3
https://python.microbit.org
MIT License
57 stars 36 forks source link

Prevent the show simulator button from stealing focus in some situations. #900

Closed microbit-robert closed 2 years ago

microbit-robert commented 2 years ago

Closes #893.

github-actions[bot] commented 2 years ago

Preview build will be at https://review-python-editor-next.microbit.org/sim-focus-bug/?flag=simulator

microbit-robert commented 2 years ago

I don't like introducing the extra state, but can't think of an alternative way to do it without having to wait for the 'show simulator' button to be available on the page.

microbit-matt-hillsdon commented 2 years ago

I don't like introducing the extra state, but can't think of an alternative way to do it without having to wait for the 'show simulator' button to be available on the page.

Took me a while to understand but I think this makes sense. I think ideally they'd be the same button in the show and hide case (not tried this!) and then no special focus management would be necessary.

microbit-matt-hillsdon commented 2 years ago

Merged with main, will check sim works on the branch then merge.