-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(overlay): set overlay size #1583
Conversation
width: number; | ||
|
||
/** The height of the overlay panel **/ | ||
height: number; |
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 support percent with this as well. I'd make the type number|string
, assume numbers are px
and strings are whole units.
state.height = 500; | ||
|
||
overlay.create(state).attach(componentPortal); | ||
const pane = (<HTMLElement>overlayContainerElement.children[0]); |
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 want to start preferring the as
cast syntax.
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.
LGTM aside from a couple minor comments
@@ -58,6 +59,17 @@ export class OverlayRef implements PortalHost { | |||
} | |||
} | |||
|
|||
/** Updates the size of the overlay based on the overlay config. */ | |||
updateSize() { | |||
if (this._state.width) { |
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.
It should probably work for zero as well.
@@ -98,3 +110,7 @@ export class OverlayRef implements PortalHost { | |||
} | |||
} | |||
} | |||
|
|||
export function coerceToCSSFormat(value: number | 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.
formatCssUnit
?
Also it doesn't need to be exported just yet
@jelbourn Comments addressed! |
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. |
This PR adds two properties to the overlay state to manually configure the size of the overlay.
r: @jelbourn