Skip to content
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: popover is clipping in modal #17840

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion packages/react/src/components/Modal/Modal.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default {

export const Default = () => {
const [open, setOpen] = useState(true);
const [openPopover, setOpenPopover] = useState(false);
const menuTargetref = useRef(null);
return (
<>
Expand All @@ -61,7 +62,26 @@ export const Default = () => {
organization to a URL that you own. A custom domain can be a shared
domain, a shared subdomain, or a shared domain and host.
</p>

<Popover open={openPopover} autoAlign>
<div className="playground-trigger">
<CheckboxIcon
onClick={() => {
setOpenPopover(!openPopover);
}}
/>
</div>
<PopoverContent className="p-3">
<div>
<p className="popover-title">This popover uses autoAlign</p>
<p className="popover-details">
Scroll the container up, down, left or right to observe how the
popover will automatically change its position in attempt to
stay within the viewport. This works on initial render in
addition to on scroll.
</p>
</div>
</PopoverContent>
</Popover>
<TextInput
data-modal-primary-focus
id="text-input-1"
Expand Down
9 changes: 4 additions & 5 deletions packages/styles/scss/components/popover/_popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ $popover-caret-height: custom-property.get-var(
}

// Drop shadow modifier
.#{$prefix}--popover--drop-shadow .#{$prefix}--popover {
@include custom-property.declaration(
'popover-drop-shadow',
drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2))
);
.#{$prefix}--popover--drop-shadow
.#{$prefix}--popover
> .#{$prefix}--popover-content {
filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

// Caret tip modifier
Expand Down
Loading