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

fix(Tabs): Execute click handler on Button #1847

Merged
merged 4 commits into from
Feb 11, 2025

Conversation

VincentSmedinga
Copy link
Contributor

@VincentSmedinga VincentSmedinga commented Feb 3, 2025

Describe the pull request

Thank you for contributing to the project!
Please use this template to help us handle your PR smoothly.

What

Disallows children of a Tabs.Button to become the target of pointer events.

Why

To ensure the click event always returns the button as its target.

How

Through CSS.

Checklist

Before submitting your pull request, please ensure you have done the following. Check each checkmark if you have done so or if it wasn't necessary:

  • Add or update unit tests
  • Add or update documentation
  • Add or update stories
  • Add or update exports in index.* files
  • Start the PR title with a Conventional Commit prefix, as explained here.

Additional notes

  • Adresses V0.14.0 Inconsistent MouseEvent Target in Tabs Component #1846.
  • We can release this as a 0.14.1 hotfix. This is why it merges into a release branch.
  • I considered adding a Storybook interaction test, but decided against it to keep the bugfix minimal. We should make a start with the subject, though.
  • Test this by adding onClick: (e: MouseEvent<HTMLElement>) => console.log('e.target:', e.target) to the args of the Tabs stories while importing MouseEvent from React.

@VincentSmedinga VincentSmedinga requested a review from a team as a code owner February 3, 2025 10:03
@VincentSmedinga VincentSmedinga changed the base branch from develop to main February 3, 2025 10:06
dlnr
dlnr previously approved these changes Feb 3, 2025
@github-actions github-actions bot temporarily deployed to demo-DES-1164-tabs-button-mouse-event-target February 3, 2025 11:02 Destroyed
@VincentSmedinga VincentSmedinga force-pushed the fix/DES-1164-tabs-button-mouse-event-target branch from 2ebb4f6 to 13fec92 Compare February 4, 2025 12:54
@github-actions github-actions bot temporarily deployed to demo-DES-1164-tabs-button-mouse-event-target February 4, 2025 12:54 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-1164-tabs-button-mouse-event-target February 5, 2025 12:52 Destroyed
@VincentSmedinga VincentSmedinga changed the base branch from main to release/v14.1.0 February 5, 2025 14:43
@VincentSmedinga VincentSmedinga changed the title fix(Tabs): Ensure Button to be the target of pointer events fix(Tabs): Execute click handler on Button and ensure button element is the event target Feb 7, 2025
Copy link
Contributor

@RubenSibon RubenSibon left a comment

Choose a reason for hiding this comment

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

LGTM; one comment about the wildcard CSS selector.

@RubenSibon RubenSibon self-requested a review February 10, 2025 12:52
@github-actions github-actions bot temporarily deployed to demo-DES-1164-tabs-button-mouse-event-target February 11, 2025 08:06 Destroyed
@VincentSmedinga VincentSmedinga changed the title fix(Tabs): Execute click handler on Button and ensure button element is the event target fix(Tabs): Execute click handler on Button Feb 11, 2025
@alimpens alimpens merged commit d91ef67 into release/v0.14.1 Feb 11, 2025
5 checks passed
@alimpens alimpens deleted the fix/DES-1164-tabs-button-mouse-event-target branch February 11, 2025 08:38
@github-actions github-actions bot mentioned this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants