fix(editor): arrowhead picker overflowing viewport (#10943)
This commit is contained in:
@@ -8,7 +8,6 @@
|
|||||||
border: 0 solid color.adjust(#fff, $alpha: -0.75);
|
border: 0 solid color.adjust(#fff, $alpha: -0.75);
|
||||||
box-shadow: var(--shadow-island-stronger);
|
box-shadow: var(--shadow-island-stronger);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
position: absolute;
|
|
||||||
:root[dir="rtl"] & {
|
:root[dir="rtl"] & {
|
||||||
padding: 0.4rem;
|
padding: 0.4rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { atom, useAtom } from "../editor-jotai";
|
|||||||
import { getLanguage, t } from "../i18n";
|
import { getLanguage, t } from "../i18n";
|
||||||
|
|
||||||
import Collapsible from "./Stats/Collapsible";
|
import Collapsible from "./Stats/Collapsible";
|
||||||
import { useEditorInterface, useExcalidrawContainer } from "./App";
|
import { useExcalidrawContainer } from "./App";
|
||||||
|
|
||||||
import "./IconPicker.scss";
|
import "./IconPicker.scss";
|
||||||
|
|
||||||
@@ -79,7 +79,6 @@ function Picker<T>({
|
|||||||
onChange: (value: T) => void;
|
onChange: (value: T) => void;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}) {
|
}) {
|
||||||
const editorInterface = useEditorInterface();
|
|
||||||
const { container } = useExcalidrawContainer();
|
const { container } = useExcalidrawContainer();
|
||||||
const [showMoreOptions, setShowMoreOptions] = useAtom(moreOptionsAtom);
|
const [showMoreOptions, setShowMoreOptions] = useAtom(moreOptionsAtom);
|
||||||
const allSections = [...visibleSections, ...hiddenSections];
|
const allSections = [...visibleSections, ...hiddenSections];
|
||||||
@@ -248,41 +247,37 @@ function Picker<T>({
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const isMobile = editorInterface.formFactor === "phone";
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover.Content
|
<Popover.Content
|
||||||
side={isMobile ? "right" : "bottom"}
|
className="picker"
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
aria-label={label}
|
||||||
|
side={"bottom"}
|
||||||
align="start"
|
align="start"
|
||||||
sideOffset={isMobile ? 8 : 12}
|
sideOffset={12}
|
||||||
|
alignOffset={12}
|
||||||
style={{ zIndex: "var(--zIndex-ui-styles-popup)" }}
|
style={{ zIndex: "var(--zIndex-ui-styles-popup)" }}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
collisionBoundary={container ?? undefined}
|
collisionBoundary={container ?? undefined}
|
||||||
>
|
>
|
||||||
<div
|
<div className="picker-sections">
|
||||||
className={`picker`}
|
{renderSections(visibleSections)}
|
||||||
role="dialog"
|
|
||||||
aria-modal="true"
|
|
||||||
aria-label={label}
|
|
||||||
>
|
|
||||||
<div className="picker-sections">
|
|
||||||
{renderSections(visibleSections)}
|
|
||||||
|
|
||||||
{hiddenSections.length > 0 && (
|
{hiddenSections.length > 0 && (
|
||||||
<Collapsible
|
<Collapsible
|
||||||
label={t("labels.more_options")}
|
label={t("labels.more_options")}
|
||||||
open={showMoreOptions}
|
open={showMoreOptions}
|
||||||
openTrigger={() => {
|
openTrigger={() => {
|
||||||
setShowMoreOptions((value) => !value);
|
setShowMoreOptions((value) => !value);
|
||||||
}}
|
}}
|
||||||
className="picker-collapsible"
|
className="picker-collapsible"
|
||||||
>
|
>
|
||||||
<div className="picker-sections">
|
<div className="picker-sections">
|
||||||
{renderSections(hiddenSections)}
|
{renderSections(hiddenSections)}
|
||||||
</div>
|
</div>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Popover.Content>
|
</Popover.Content>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user