Skip to content
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

Close tabs on middle click #1371

Merged
merged 2 commits into from
Aug 11, 2023

Conversation

dcdenu4
Copy link
Member

@dcdenu4 dcdenu4 commented Aug 11, 2023

Description

Prevent the default behavior of a middle click opening a new window / tab on an InVEST Tab and instead close that tab.

I was unsure of whether this should live on the Nav.Link element or up one on the Nav.Item element. I opted for Nav.Link because the default nature of middle click on links...

I was unsure of whether this deserved a test? I could not find a "close tab" / "switch tab" test in investtabtest

Manually verified behavior on Windows with mouse wheel middle click in development build.

Fixes #1261

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
  • [ ] Updated the user's guide (if needed)
  • Tested the affected models' UIs (if relevant)

@dcdenu4 dcdenu4 requested a review from davemfish August 11, 2023 15:42
@dcdenu4 dcdenu4 added this to the 3.14.0 milestone Aug 11, 2023
Copy link
Contributor

@davemfish davemfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I don't think this requires testing. But FYI the tests that open and close tabs are in app.test.js.

And I think it makes sense to place this handler on the Nav.Link, not the Nav.Item.

@davemfish davemfish merged commit 3c0f155 into natcap:main Aug 11, 2023
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.

Middle-clicking a workbench tab opens a new blank window
2 participants