Skip to content

Conversation

@eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 11, 2019

Replaces alert() with console.info() because

  1. alert() is quite disruptive (especially when testing keyboard interactions)
  2. That an interaction happened should be obvious from the component itself not by using a browser API that isn't used nowadays anyway.
  3. We are not consistent with alerting about interactions anyway (some of them don't even log) so it was never that important to be so assertive about the interaction in the first place.

@eps1lon eps1lon added the docs Improvements or additions to the documentation. label Nov 11, 2019

const handleDelete = (chipToDelete: ChipData) => () => {
if (chipToDelete.label === 'React') {
alert('Why would you want to delete React?! :)');
Copy link
Member

Choose a reason for hiding this comment

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

This one might be the only one it the code base that is justified. Without, it's unclear why clicking the delete button does nothing for React while it removes the other tags.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll rewrite this so it isn't handled in the first place. In the end why mark a chip as deletable if it isn't?

Copy link
Member

Choose a reason for hiding this comment

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

Right 👌

@mui-pr-bot
Copy link

mui-pr-bot commented Nov 11, 2019

No bundle size changes comparing 575776f...9257c25

Generated by 🚫 dangerJS against 9257c25

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

Labels

docs Improvements or additions to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants