Skip to content

Commit

Permalink
fix: popover is clipping in modal (#17840)
Browse files Browse the repository at this point in the history
  • Loading branch information
preetibansalui authored Oct 23, 2024
1 parent 66c14c2 commit abde1a4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
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

0 comments on commit abde1a4

Please sign in to comment.