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

[Snackbar] Static properties for reason string constants #10300

Merged
merged 1 commit into from
Feb 24, 2018

Conversation

RavenHursT
Copy link

Allows for users to utilize IDE autocompletion for these "reason" passed to .onRequestClose() limiting typos and simplifying refactors.

Allows for users to utilize IDE autocompletion for these "reason" passed to `.onRequestClose()`
@@ -103,6 +103,11 @@ class Snackbar extends Component {
muiTheme: PropTypes.object.isRequired,
};

static reasons = {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be renamed to closeReasons?

Copy link
Author

Choose a reason for hiding this comment

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

Not sure that's really needed for something as simple as this PR is addressing?

Copy link
Author

Choose a reason for hiding this comment

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

Also matches the name of the argument given in the documentation..

Copy link
Author

Choose a reason for hiding this comment

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

http://www.material-ui.com/#/components/snackbar

"The reason parameter can optionally be used to control the response to onRequestClose, for example ignoring clickaway."

Copy link
Member

Choose a reason for hiding this comment

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

ok - sounds good

@hai-cea hai-cea merged commit 526b7c8 into mui:master Feb 24, 2018
@hai-cea
Copy link
Member

hai-cea commented Feb 24, 2018

Thanks @RavenHursT

@RavenHursT RavenHursT deleted the patch-1 branch February 26, 2018 15:38
djbuckley added a commit to manchesergit/material-ui that referenced this pull request Apr 21, 2018
* commit 'fbfd478b85d02c1fc61ce525bee832f960792bfa':
  Use selectionEnd instead of selectionEnd to fix caret position issue (mui#10214)
  Static properties for reason string constants (mui#10300)
  conditionally apply overlay bkg (mui#9811)
  fix: handle case where ref is null (mui#10006)
  [EnhancedButton] Fix onClick event being fired twice on "Enter Key" press (mui#9439)
  The Popover does not listen to events unless it is open at the moment (mui#9482)
  [docs] Add v1 recommendation to home page (mui#9727)
  [Tabs] Add support for inline style override for parent container of InkBar (mui#9598)

# Conflicts:
#	src/Popover/Popover.js
#	src/Slider/Slider.js
#	src/Snackbar/Snackbar.js
@oliviertassinari oliviertassinari changed the title Static properties for reason string constants [Snackbar] Static properties for reason string constants May 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants