diff --git a/packages/docs-app/src/examples/core-examples/overlayExample.tsx b/packages/docs-app/src/examples/core-examples/overlayExample.tsx index 43e1e19c20..e70ada42d4 100644 --- a/packages/docs-app/src/examples/core-examples/overlayExample.tsx +++ b/packages/docs-app/src/examples/core-examples/overlayExample.tsx @@ -11,6 +11,7 @@ import { Example, handleBooleanChange, IExampleProps } from "@blueprintjs/docs-t import { IBlueprintExampleData } from "../../tags/reactExamples"; const OVERLAY_EXAMPLE_CLASS = "docs-overlay-example-transition"; +const OVERLAY_TALL_CLASS = "docs-overlay-example-tall"; export interface IOverlayExampleState { autoFocus: boolean; @@ -20,6 +21,7 @@ export interface IOverlayExampleState { hasBackdrop: boolean; isOpen: boolean; usePortal: boolean; + useTallContent: boolean; } export class OverlayExample extends React.PureComponent, IOverlayExampleState> { @@ -31,6 +33,7 @@ export class OverlayExample extends React.PureComponent this.setState({ canOutsideClickClose: val })); public render() { - const classes = classNames(Classes.CARD, Classes.ELEVATION_4, OVERLAY_EXAMPLE_CLASS, this.props.data.themeName); + const classes = classNames( + Classes.CARD, + Classes.ELEVATION_4, + OVERLAY_EXAMPLE_CLASS, + this.props.data.themeName, + { [OVERLAY_TALL_CLASS]: this.state.useTallContent }, + ); return ( @@ -60,18 +69,33 @@ export class OverlayExample extends React.PureComponent

- Click the right button below to transfer focus to the "Show overlay" trigger button outside - of this overlay. If persistent focus is enabled, focus will be constrained to the overlay. - Use the tab key to move to the next focusable element to illustrate this - effect. + Click the "Focus button" below to transfer focus to the "Show overlay" trigger button + outside of this overlay. If persistent focus is enabled, focus will be constrained to the + overlay. Use the tab key to move to the next focusable element to illustrate + this effect. +

+

+ Click the "Make me scroll" button below to make this overlay's content really tall, which + will make the overlay's container (but not the page) scrollable


- - +
+ + + +
@@ -100,7 +124,8 @@ export class OverlayExample extends React.PureComponent this.setState({ isOpen: true }); - private handleClose = () => this.setState({ isOpen: false }); + private handleClose = () => this.setState({ isOpen: false, useTallContent: false }); private focusButton = () => this.button.focus(); + private toggleScrollButton = () => this.setState({ useTallContent: !this.state.useTallContent }); } diff --git a/packages/docs-app/src/styles/_examples.scss b/packages/docs-app/src/styles/_examples.scss index 5e423c74f9..32ce8390c0 100644 --- a/packages/docs-app/src/styles/_examples.scss +++ b/packages/docs-app/src/styles/_examples.scss @@ -243,11 +243,15 @@ ); top: 0; - left: calc(50% - #{$overlay-example-width / 2}); + left: calc(50vw - #{$overlay-example-width / 2}); margin: 10vh 0; width: $overlay-example-width; } +.docs-overlay-example-tall { + height: 200%; +} + #{example("PopoverExample")} { .docs-example { display: block;