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

Replace mouse events with pointer events in applicable components #8974

Merged
merged 13 commits into from
May 19, 2024

Conversation

danielchalmers
Copy link
Contributor

@danielchalmers danielchalmers commented May 15, 2024

Description

Naturally supports mouse, touch, and pen (among other) inputs uniformly which improves accessibility and should be preferred for modern applications.

All functionality should be the same for existing mice users

Migration Guide:

  • TableRowHoverEventArgs and Table methods now accept PointerEventArgs instead of MouseEventArgs

How Has This Been Tested?

unit, visually

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

Naturally supporst mouse, touch, and pen input uniformly and should be preferred for modern applications

All functionality should be the same for mice users

- Removed !NET7_0_OR_GREATER code
- Renamed MouseEvent.MouseOver -> HoverOver
- Renamed MouseEvent -> PointerEvent
- Switched a few classes to file scoped namespaces
@github-actions github-actions bot added bug Something does not work as intended/expected PR: needs review labels May 15, 2024
Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 90.49%. Comparing base (28bc599) to head (70688ce).
Report is 214 commits behind head on dev.

Files Patch % Lines
...c/MudBlazor/Components/Tooltip/MudTooltip.razor.cs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8974      +/-   ##
==========================================
+ Coverage   89.82%   90.49%   +0.66%     
==========================================
  Files         412      394      -18     
  Lines       11878    12139     +261     
  Branches     2364     2369       +5     
==========================================
+ Hits        10670    10985     +315     
+ Misses        681      621      -60     
- Partials      527      533       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielchalmers
Copy link
Contributor Author

@henon @ScarletKuro Could I get a bit of help testing the Table and DataGrid? Don't think the resizer is working but I never use those two controls 🤷

@Anu6is
Copy link
Contributor

Anu6is commented May 15, 2024

Renamed MouseEvent.MouseOver -> HoverOver

Shouldn't it just be Hover?

@henon
Copy link
Collaborator

henon commented May 15, 2024

MouseOver is already the perfect name, I'm against renaming it.

@henon
Copy link
Collaborator

henon commented May 15, 2024

@henon @ScarletKuro Could I get a bit of help testing the Table and DataGrid? Don't think the resizer is working but I never use those two controls 🤷

Could you compare against v6 behavior to see if something broke.

@danielchalmers
Copy link
Contributor Author

danielchalmers commented May 15, 2024

MouseOver is already the perfect name, I'm against renaming it.

@henon PointerOver?

EDIT: @Anu6is because it's the event from the pointer being over, not exclusively the mouse. but i think Hover is also good

@henon
Copy link
Collaborator

henon commented May 15, 2024

Touch can not hover only Mouse can, that's why I think MouseOver is still a good name.

@danielchalmers
Copy link
Contributor Author

Touch can not hover only Mouse can, that's why I think MouseOver is still a good name.

@henon don't forget pens, etc

@henon
Copy link
Collaborator

henon commented May 15, 2024

OK let's do PointerOver

@danielchalmers danielchalmers changed the title Use pointer events in more components Replace mouse events with pointer events in applicable components May 15, 2024
@henon henon added breaking change v7 New major MudBlazor version labels May 15, 2024
@danielchalmers
Copy link
Contributor Author

Tests pass and I've manually checked and all seems the same with mouse. This will help with accessibility.

@ScarletKuro
Copy link
Member

I think it would be nice to merge #8972 before this.

@danielchalmers
Copy link
Contributor Author

I think it would be nice to merge #8972 before this.

@ScarletKuro Do you mind fixing the conflict for me? Or i can do it when i get home nbd

@ScarletKuro
Copy link
Member

@ScarletKuro Do you mind fixing the conflict for me? Or i can do it when i get home nbd

Idm, but I will do it tmr in that case, it's pretty late for me now.

@ScarletKuro
Copy link
Member

@ScarletKuro Do you mind fixing the conflict for me?

Done

@danielchalmers
Copy link
Contributor Author

@henon Should be good now

@henon
Copy link
Collaborator

henon commented May 18, 2024

Migration Guide:

  • MouseEvent.MouseOver -> PointerOver
  • MouseEvent -> PointerEvent
  • OnRowMouseEnter -> OnRowPointerEnter
  • OnRowMouseLeave -> OnRowPointerLeave

I am not sure about the renames. I feel like I'd rather leave the names all the same including the MouseEvent enum. Supporting pens and touch devices is one thing but renaming everything is quite unnecessary. And I feel it doesn't make the API so much better that it is justified.

@danielchalmers
Copy link
Contributor Author

I am not sure about the renames. I feel like I'd rather leave the names all the same including the MouseEvent enum. Supporting pens and touch devices is one thing but renaming everything is quite unnecessary. And I feel it doesn't make the API so much better that it is justified.

It's a good point, either way is fine. Let me know and I'll change them back. @henon

@danielchalmers
Copy link
Contributor Author

@henon Public API is now back to *Mouse*

@henon henon merged commit 8abf04d into MudBlazor:dev May 19, 2024
4 checks passed
@henon henon mentioned this pull request May 19, 2024
@danielchalmers danielchalmers deleted the mouse-pointer-events branch May 19, 2024 19:43
@henon
Copy link
Collaborator

henon commented May 19, 2024

Thanks!

Added to v7.0.0 Migration Guide #8447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility breaking change bug Something does not work as intended/expected v7 New major MudBlazor version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants