Skip to content

Chip: Don't apply hover or focus effect if not clickable and allow text selection#8598

Merged
henon merged 2 commits intoMudBlazor:devfrom
danielchalmers:chip-interactive-hover
Apr 9, 2024
Merged

Chip: Don't apply hover or focus effect if not clickable and allow text selection#8598
henon merged 2 commits intoMudBlazor:devfrom
danielchalmers:chip-interactive-hover

Conversation

@danielchalmers
Copy link
Member

@danielchalmers danielchalmers commented Apr 7, 2024

Description

How Has This Been Tested?

visually

Types 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)

Resolves #7243
Hover before:

hoverbefore.mp4

Hover after:

hoverafter.mp4

Clickable chips remain the same.
Before:

chipsetbefore.mp4

After:

chipsetafter.mp4

Additionally resolves #7420
Before:

selectionbefore.mp4

After:

selectionafter.mp4

It does not interfere with the click effect but allows the user to drag the mouse or double click to select text.

Checklist

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

@danielchalmers danielchalmers requested a review from henon April 7, 2024 04:03
@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Apr 7, 2024
@codecov
Copy link

codecov bot commented Apr 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.89%. Comparing base (f70bb9e) to head (bda57e9).
Report is 11 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8598      +/-   ##
==========================================
+ Coverage   89.78%   89.89%   +0.11%     
==========================================
  Files         411      412       +1     
  Lines       11840    11881      +41     
  Branches     2363     2362       -1     
==========================================
+ Hits        10630    10680      +50     
+ Misses        682      675       -7     
+ Partials      528      526       -2     

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

@henon
Copy link
Contributor

henon commented Apr 8, 2024

So clickable chips can not be selected but readonly chips can? I see a ripple in the video where you selected text on the chip. Should we also disable the ripple if the chip is not clickable?

@danielchalmers
Copy link
Member Author

So clickable chips can not be selected but readonly chips can? I see a ripple in the video where you selected text on the chip. Should we also disable the ripple if the chip is not clickable?

I would probably make it work like MUI but I'll leave those decisions to someone else because I don't use the chips enough to have an opinion. I just copied the other PRs.

@henon
Copy link
Contributor

henon commented Apr 8, 2024

OK, in MUI clickable chips are not selectable but do hover and ripple. Non-clickable are selectable but don't hover and have no ripple. If it is like that now this can be merged.

@danielchalmers
Copy link
Member Author

OK, in MUI clickable chips are not selectable but do hover and ripple. Non-clickable are selectable but don't hover and have no ripple. If it is like that now this can be merged.

I can make it like that if that's the consensus (I agree)

@henon
Copy link
Contributor

henon commented Apr 8, 2024

Yes, let's do it like that. No need to make it more complicated if we already agree ;)

@danielchalmers danielchalmers changed the title Chip: Only apply hover effect if clickable Chip: Don'apply hover or focus effect and allow text selection if not clickable Apr 8, 2024
@danielchalmers danielchalmers changed the title Chip: Don'apply hover or focus effect and allow text selection if not clickable Chip: Don't apply hover or focus effect if not clickable and allow text selection Apr 8, 2024
@danielchalmers
Copy link
Member Author

@henon Done. Please checkout the branch and see if it's what you expect

@henon henon added breaking change This change will require consumer code updates v7 and removed PR: needs review labels Apr 9, 2024
@henon henon merged commit 8a99dd9 into MudBlazor:dev Apr 9, 2024
@henon
Copy link
Contributor

henon commented Apr 9, 2024

Thanks @danielchalmers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudChip text selectable Chip: Add ReadOnly mode

2 participants