-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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(dialog): add configurable width, height and position #1848
feat(dialog): add configurable width, height and position #1848
Conversation
d8fc95c
to
1bb14f1
Compare
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.
We should also add tests for dialog that the explicit size/position are passed through.
@@ -1,3 +1,8 @@ | |||
.demo-dialog { | |||
color: rebeccapurple; | |||
} | |||
|
|||
md-card { |
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.
Can you use a class with demo-
prefix for this?
|
||
if (value === '100%') { | ||
// When the width is 100%, we should reset the `left` and the offset, | ||
// in order to ensure that the element is flush against the viewport edge. |
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.
Can you put the comment on top of the if
?
// When the width is 100%, we should reset the `left` and the offset,
// in order to ensure that the element is flush against the viewport edge.
if (value === '100%') {
this.left('0px');
}
(here and in height
)
/** | ||
* Centers the overlay horizontally with an optional offset. | ||
* Clears any previously set horizontal position. | ||
*/ | ||
centerHorizontally(offset = '0px') { | ||
centerHorizontally(offset?: string) { |
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.
Could also do
centerHorizontally(offset = '') {
padding: $md-dialog-padding; | ||
border-radius: $md-dialog-border-radius; | ||
width: 100%; |
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.
Add a comment like
// The dialog container should completely fill its parent overlay element.
.centerVertically(); | ||
state.positionStrategy = strategy; | ||
|
||
// TODO(crisbeto): replace with `horizontal` to support RTL? |
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 think that if someone is manually setting the position of the dialog that they should be in change of dealing with RTL.
* Adds the ability to set a dialog's `width` and `height`. * Adds the ability to set a dialog's position. If only the position in one axis is overridden, the other axis will stay centered. * Fixes the `GlobalPositionStrategy` adding an unnecessary `0px` transform. * Makes the dialog scrollable. * Adds more options to the dialog demo so it's easier to test them out. Fixes angular#1698.
1bb14f1
to
b18a422
Compare
Addressed the feedback @jelbourn |
LGTM |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
width
andheight
.GlobalPositionStrategy
adding an unnecessary0px
transform.Fixes #1698.