-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix Toast stacking #419
fix Toast stacking #419
Conversation
this avoids leaking the mutation and allows more than one of each Toast to appear in the example.
so they also stack when `inline`. fixes #367
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.
Looks reasonable. 👍
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.
code looks ok; did not test in browsers
@@ -89,6 +93,9 @@ export class Toaster extends AbstractComponent<IToasterProps, IToasterState> imp | |||
* The `Toaster` will be rendered into a new element appended to the given container. | |||
*/ | |||
public static create(props?: IToasterProps, container = document.body): IToaster { | |||
if (props != null && props.inline != null) { |
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.
would prefer explicit checks against undefined
; we don't really need to support nulls
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.
i'm just so used to doing it this way.
how about if we tackle that change across the codebase when we enable strictNullChecks
?
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.
sure, but it won't get flagged for you automatically; you'll need to look for all such comparisons against null
. in my ideal world, we also enable the no-null-keyword
lint rule and any explicit usage of null
would have to be whitelisted
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.
sure that sounds reasonable!
Fixes #367
Checklist
Changes proposed in this pull request:
position: relative
so they also stack wheninline
.Reviewers should focus on: