import React from "react"; import { css } from "@emotion/css"; import Dropdownable, { Direction } from "../../components/Dropdownable"; import { PrimaryButton, SecondaryButton } from "../../../button"; import { DropdownContentContainer } from "./DropdownStory"; const DropdownStoryFit = ({ children }) => { const [isOpen, setIsOpen] = React.useState(false); const [expanded, setExpanded] = React.useState(false); const containerStyle = css({ display: "flex", ["align-items"]: "center", ["justify-content"]: "flex-end", ["min-height"]: expanded ? "400px" : "40px" }); function toggleExpand() { setExpanded(!expanded); } function handleClose() { setIsOpen(false); } function handleOpen( event?: React.SyntheticEvent | undefined ) { event?.preventDefault(); setIsOpen(true); event?.stopPropagation(); } return (

I prefer to be positioned on the top

Click outside to dismiss

Also try resizing

Click the other button to make more vertical space

Click the other button to make more vertical space

Click the other button to make more vertical space

Click the other button to make more vertical space

Click the other button to make more vertical space

} > handleOpen(event)}> {children}
{expanded ? "Collapse" : "Expand"}
); }; export default DropdownStoryFit;