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

feat(chip): add closeOnDelete prop #10877

Merged

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Nov 26, 2024

Related Issue: #6825

Summary

This prop will allow developers to configure whether a chip will close on Delete when focused.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Nov 26, 2024
@jcfranco jcfranco added the skip visual snapshots Pull requests that do not need visual regression testing. label Nov 26, 2024
@jcfranco jcfranco changed the title feat(chip): add closeOnEscape prop to close a closable chip via keyboard feat(chip): add closeOnEscape prop Nov 26, 2024
Copy link
Contributor

@macandcheese macandcheese 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! Couple q:

  • Could you update the title from closeOnEscape?
  • This works when both the entire chip is focused and when the close button itself is focused. Just confirming we want this to happen in both cases (I think we do)
  • Should this also include backspace support? If so, do we need a different name (closeOnKeyboard... etc)

@jcfranco jcfranco changed the title feat(chip): add closeOnEscape prop feat(chip): add closeOnDelete prop Nov 26, 2024
@jcfranco
Copy link
Member Author

@macandcheese Excellent questions:

  1. Fixed! My fingers keep typing Escape despite many edits for some reason. 🤣
  2. I thought about ignoring Delete when the close button is focused, but it seems more consistent and straightforward to close regardless.
  3. Solid point. Looking at our current Escape usage, aligning for consistency makes sense. I’m not sure what the prop should be named in this case. Open to suggestions here. 😅

@macandcheese
Copy link
Contributor

macandcheese commented Nov 26, 2024

I’m not sure what the prop should be named in this case. Open to suggestions here. 😅

Yeah - tough one to name. closeOnKeyboard with specific description could work. Or even leaving closeOnDelete with a description that includes "backspace and delete" keys could work.

Some keyboards (mainly ones marketed for Mac) have "delete" written on the backspace key anyway. For some laptops there is no "delete" standalone anyway. All that to say - maybe closeOnDelete is ok lol

@jcfranco
Copy link
Member Author

Proceeding with closeOnDelete!

@jcfranco jcfranco merged commit f0e9d0b into dev Nov 27, 2024
10 checks passed
@jcfranco jcfranco deleted the jcfranco/6825-allow-chip-closing-when-focused-with-delete branch November 27, 2024 01:40
@github-actions github-actions bot added this to the 2024-12-17 - Dec Milestone milestone Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants