-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Conversation
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 = { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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..
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok - sounds good
Thanks @RavenHursT |
* 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
Allows for users to utilize IDE autocompletion for these "reason" passed to
.onRequestClose()
limiting typos and simplifying refactors.