forked from github/plane
fix: filters dropdown overflowing issue (#513)
* fix: filters dropdown overflowing issue * filters dropdown z-index
This commit is contained in:
parent
f01f2fb9bd
commit
f3b7fc6eb5
@ -189,7 +189,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
isOpen={contextMenu}
|
isOpen={contextMenu}
|
||||||
setIsOpen={setContextMenu}
|
setIsOpen={setContextMenu}
|
||||||
>
|
>
|
||||||
{!isNotAllowed &&(
|
{!isNotAllowed && (
|
||||||
<>
|
<>
|
||||||
<ContextMenu.Item Icon={PencilIcon} onClick={editIssue}>
|
<ContextMenu.Item Icon={PencilIcon} onClick={editIssue}>
|
||||||
Edit issue
|
Edit issue
|
||||||
@ -222,7 +222,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
>
|
>
|
||||||
<div className="group/card relative select-none p-3.5">
|
<div className="group/card relative select-none p-3.5">
|
||||||
{!isNotAllowed && (
|
{!isNotAllowed && (
|
||||||
<div className="absolute top-1.5 right-1.5 z-10 opacity-0 group-hover/card:opacity-100">
|
<div className="z-1 absolute top-1.5 right-1.5 opacity-0 group-hover/card:opacity-100">
|
||||||
{type && !isNotAllowed && (
|
{type && !isNotAllowed && (
|
||||||
<CustomMenu width="auto" ellipsis>
|
<CustomMenu width="auto" ellipsis>
|
||||||
<CustomMenu.MenuItem onClick={editIssue}>Edit issue</CustomMenu.MenuItem>
|
<CustomMenu.MenuItem onClick={editIssue}>Edit issue</CustomMenu.MenuItem>
|
||||||
|
@ -83,6 +83,7 @@ export const IssuesFilterView: React.FC = () => {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
direction="left"
|
direction="left"
|
||||||
|
height="rg"
|
||||||
/>
|
/>
|
||||||
<Popover className="relative">
|
<Popover className="relative">
|
||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
|
@ -22,6 +22,7 @@ type MultiLevelDropdownProps = {
|
|||||||
}[];
|
}[];
|
||||||
onSelect: (value: any) => void;
|
onSelect: (value: any) => void;
|
||||||
direction?: "left" | "right";
|
direction?: "left" | "right";
|
||||||
|
height?: "sm" | "md" | "rg" | "lg";
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MultiLevelDropdown: React.FC<MultiLevelDropdownProps> = ({
|
export const MultiLevelDropdown: React.FC<MultiLevelDropdownProps> = ({
|
||||||
@ -29,6 +30,7 @@ export const MultiLevelDropdown: React.FC<MultiLevelDropdownProps> = ({
|
|||||||
options,
|
options,
|
||||||
onSelect,
|
onSelect,
|
||||||
direction = "right",
|
direction = "right",
|
||||||
|
height = "md",
|
||||||
}) => {
|
}) => {
|
||||||
const [openChildFor, setOpenChildFor] = useState<string | null>(null);
|
const [openChildFor, setOpenChildFor] = useState<string | null>(null);
|
||||||
|
|
||||||
@ -58,7 +60,7 @@ export const MultiLevelDropdown: React.FC<MultiLevelDropdownProps> = ({
|
|||||||
>
|
>
|
||||||
<Menu.Items
|
<Menu.Items
|
||||||
static
|
static
|
||||||
className="absolute right-0 mt-1 w-36 origin-top-right select-none rounded-md bg-white text-xs shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
|
className="absolute right-0 z-10 mt-1 w-36 origin-top-right select-none rounded-md bg-white text-xs shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
|
||||||
>
|
>
|
||||||
{options.map((option) => (
|
{options.map((option) => (
|
||||||
<div className="relative p-1" key={option.id}>
|
<div className="relative p-1" key={option.id}>
|
||||||
@ -100,10 +102,20 @@ export const MultiLevelDropdown: React.FC<MultiLevelDropdownProps> = ({
|
|||||||
{option.children && option.id === openChildFor && (
|
{option.children && option.id === openChildFor && (
|
||||||
<Menu.Items
|
<Menu.Items
|
||||||
static
|
static
|
||||||
className={`absolute top-0 w-36 origin-top-right select-none rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ${
|
className={`absolute top-0 w-36 origin-top-right select-none overflow-y-scroll rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ${
|
||||||
direction === "left"
|
direction === "left"
|
||||||
? "right-full -translate-x-1"
|
? "right-full -translate-x-1"
|
||||||
: "left-full translate-x-1"
|
: "left-full translate-x-1"
|
||||||
|
} ${
|
||||||
|
height === "sm"
|
||||||
|
? "max-h-28"
|
||||||
|
: height === "md"
|
||||||
|
? "max-h-44"
|
||||||
|
: height === "rg"
|
||||||
|
? "max-h-56"
|
||||||
|
: height === "lg"
|
||||||
|
? "max-h-80"
|
||||||
|
: ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="space-y-1 p-1">
|
<div className="space-y-1 p-1">
|
||||||
@ -118,7 +130,7 @@ export const MultiLevelDropdown: React.FC<MultiLevelDropdownProps> = ({
|
|||||||
className={({ active }) =>
|
className={({ active }) =>
|
||||||
`${
|
`${
|
||||||
active || child.selected ? "bg-gray-100" : "text-gray-900"
|
active || child.selected ? "bg-gray-100" : "text-gray-900"
|
||||||
} flex w-full items-center rounded px-1 py-1.5 capitalize`
|
} flex w-full items-center break-all rounded px-1 py-1.5 capitalize`
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{child.label}
|
{child.label}
|
||||||
|
@ -22,9 +22,15 @@ type Props = {
|
|||||||
filters: IIssueFilterOptions | IQuery;
|
filters: IIssueFilterOptions | IQuery;
|
||||||
onSelect: (option: any) => void;
|
onSelect: (option: any) => void;
|
||||||
direction?: "left" | "right";
|
direction?: "left" | "right";
|
||||||
|
height?: "sm" | "md" | "rg" | "lg";
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SelectFilters: React.FC<Props> = ({ filters, onSelect, direction = "right" }) => {
|
export const SelectFilters: React.FC<Props> = ({
|
||||||
|
filters,
|
||||||
|
onSelect,
|
||||||
|
direction = "right",
|
||||||
|
height = "md",
|
||||||
|
}) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
|
|
||||||
@ -48,6 +54,7 @@ export const SelectFilters: React.FC<Props> = ({ filters, onSelect, direction =
|
|||||||
label="Filters"
|
label="Filters"
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
direction={direction}
|
direction={direction}
|
||||||
|
height={height}
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
id: "priority",
|
id: "priority",
|
||||||
|
Loading…
Reference in New Issue
Block a user