From b58efaf388d0be4ee16d8dbced2874de136a1f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Sz=C3=BCcs?= <127139797+balazs-szucs@users.noreply.github.com> Date: Wed, 21 Jan 2026 22:54:13 +0100 Subject: [PATCH] fix(automation): add zIndex and withinPortal props to dropdown components for improved UI consistency (#5527) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description of Changes Closes: #5525 Closes: #5242 --- ## Checklist ### General - [X] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [X] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [X] I have performed a self-review of my own code - [X] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [X] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. Signed-off-by: Balázs Szücs --- .../core/components/shared/DropdownListWithFooter.tsx | 9 ++++++++- .../addPageNumbers/AddPageNumbersAppearanceSettings.tsx | 3 +++ .../components/tools/addPassword/AddPasswordSettings.tsx | 2 ++ .../tools/addStamp/StampPositionFormattingSettings.tsx | 3 +++ .../components/tools/addStamp/StampSetupSettings.tsx | 2 ++ .../components/tools/addWatermark/WatermarkTextStyle.tsx | 3 +++ .../tools/adjustPageScale/AdjustPageScaleSettings.tsx | 2 ++ .../src/core/components/tools/automate/IconSelector.tsx | 3 +++ .../src/core/components/tools/automate/ToolSelector.tsx | 3 ++- .../tools/changeMetadata/steps/AdvancedOptionsStep.tsx | 2 ++ .../core/components/tools/compress/CompressSettings.tsx | 2 ++ .../tools/convert/ConvertFromImageSettings.tsx | 3 +++ .../components/tools/convert/ConvertToEpubSettings.tsx | 3 +++ .../components/tools/convert/ConvertToImageSettings.tsx | 3 +++ .../components/tools/convert/ConvertToPdfaSettings.tsx | 2 ++ .../components/tools/convert/GroupedFormatDropdown.tsx | 9 ++++++++- .../tools/extractImages/ExtractImagesSettings.tsx | 2 ++ .../src/core/components/tools/merge/MergeFileSorter.tsx | 2 ++ frontend/src/core/components/tools/ocr/OCRSettings.tsx | 2 ++ .../components/tools/overlayPdfs/OverlayPdfsSettings.tsx | 2 ++ .../components/tools/pageLayout/PageLayoutSettings.tsx | 2 ++ .../components/tools/redact/RedactAdvancedSettings.tsx | 2 ++ .../tools/reorganizePages/ReorganizePagesSettings.tsx | 2 ++ .../tools/replaceColor/ReplaceColorSettings.tsx | 5 +++++ .../components/tools/split/SplitAutomationSettings.tsx | 2 ++ .../src/core/components/tools/split/SplitSettings.tsx | 2 ++ frontend/src/core/styles/zIndex.ts | 2 ++ 27 files changed, 76 insertions(+), 3 deletions(-) diff --git a/frontend/src/core/components/shared/DropdownListWithFooter.tsx b/frontend/src/core/components/shared/DropdownListWithFooter.tsx index 368b2255e..b5e5a9f5d 100644 --- a/frontend/src/core/components/shared/DropdownListWithFooter.tsx +++ b/frontend/src/core/components/shared/DropdownListWithFooter.tsx @@ -2,6 +2,7 @@ import React, { ReactNode, useState, useMemo } from 'react'; import { Stack, Text, Popover, Box, Checkbox, Group, TextInput } from '@mantine/core'; import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore'; import SearchIcon from '@mui/icons-material/Search'; +import { Z_INDEX_AUTOMATE_DROPDOWN } from '@app/styles/zIndex'; export interface DropdownItem { value: string; @@ -38,6 +39,8 @@ export interface DropdownListWithFooterProps { position?: 'top' | 'bottom' | 'left' | 'right'; withArrow?: boolean; width?: 'target' | number; + withinPortal?: boolean; + zIndex?: number; } const DropdownListWithFooter: React.FC = ({ @@ -56,7 +59,9 @@ const DropdownListWithFooter: React.FC = ({ dropdownClassName = '', position = 'bottom', withArrow = false, - width = 'target' + width = 'target', + withinPortal = true, + zIndex = Z_INDEX_AUTOMATE_DROPDOWN }) => { const [searchTerm, setSearchTerm] = useState(''); @@ -114,6 +119,8 @@ const DropdownListWithFooter: React.FC = ({ withArrow={withArrow} shadow="md" onClose={() => searchable && setSearchTerm('')} + withinPortal={withinPortal} + zIndex={zIndex} > @@ -58,6 +60,7 @@ const AddPageNumbersAppearanceSettings = ({ { value: 'Courier', label: 'Courier New' }, ]} disabled={disabled} + comboboxProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> diff --git a/frontend/src/core/components/tools/addPassword/AddPasswordSettings.tsx b/frontend/src/core/components/tools/addPassword/AddPasswordSettings.tsx index e0aa7dfc7..bc046372c 100644 --- a/frontend/src/core/components/tools/addPassword/AddPasswordSettings.tsx +++ b/frontend/src/core/components/tools/addPassword/AddPasswordSettings.tsx @@ -1,6 +1,7 @@ import { Stack, PasswordInput, Select } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { AddPasswordParameters } from "@app/hooks/tools/addPassword/useAddPasswordParameters"; +import { Z_INDEX_AUTOMATE_DROPDOWN } from "@app/styles/zIndex"; interface AddPasswordSettingsProps { parameters: AddPasswordParameters; @@ -47,6 +48,7 @@ const AddPasswordSettings = ({ parameters, onParameterChange, disabled = false } { value: '128', label: t('addPassword.encryption.keyLength.128bit', '128-bit (Standard)') }, { value: '256', label: t('addPassword.encryption.keyLength.256bit', '256-bit (High)') } ]} + comboboxProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> diff --git a/frontend/src/core/components/tools/addStamp/StampPositionFormattingSettings.tsx b/frontend/src/core/components/tools/addStamp/StampPositionFormattingSettings.tsx index 058b38bc4..e7f67494d 100644 --- a/frontend/src/core/components/tools/addStamp/StampPositionFormattingSettings.tsx +++ b/frontend/src/core/components/tools/addStamp/StampPositionFormattingSettings.tsx @@ -4,6 +4,7 @@ import { AddStampParameters } from "@app/components/tools/addStamp/useAddStampPa import LocalIcon from "@app/components/shared/LocalIcon"; import styles from "@app/components/tools/addStamp/StampPreview.module.css"; import { Tooltip } from "@app/components/shared/Tooltip"; +import { Z_INDEX_AUTOMATE_DROPDOWN } from "@app/styles/zIndex"; interface StampPositionFormattingSettingsProps { parameters: AddStampParameters; @@ -176,6 +177,7 @@ const StampPositionFormattingSettings = ({ parameters, onParameterChange, disabl onChange={(value) => onParameterChange('customColor', value)} format="hex" disabled={disabled} + popoverProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> )} @@ -192,6 +194,7 @@ const StampPositionFormattingSettings = ({ parameters, onParameterChange, disabl { value: 'x-large', label: t('margin.xLarge', 'Extra Large') }, ]} disabled={disabled} + comboboxProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> )} diff --git a/frontend/src/core/components/tools/addStamp/StampSetupSettings.tsx b/frontend/src/core/components/tools/addStamp/StampSetupSettings.tsx index ac53a9a5a..17b8732c4 100644 --- a/frontend/src/core/components/tools/addStamp/StampSetupSettings.tsx +++ b/frontend/src/core/components/tools/addStamp/StampSetupSettings.tsx @@ -4,6 +4,7 @@ import { AddStampParameters } from "@app/components/tools/addStamp/useAddStampPa import ButtonSelector from "@app/components/shared/ButtonSelector"; import styles from "@app/components/tools/addStamp/StampPreview.module.css"; import { getDefaultFontSizeForAlphabet } from "@app/components/tools/addStamp/StampPreviewUtils"; +import { Z_INDEX_AUTOMATE_DROPDOWN } from "@app/styles/zIndex"; interface StampSetupSettingsProps { parameters: AddStampParameters; @@ -66,6 +67,7 @@ const StampSetupSettings = ({ parameters, onParameterChange, disabled = false }: { value: 'thai', label: 'ไทย' }, ]} disabled={disabled} + comboboxProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> )} diff --git a/frontend/src/core/components/tools/addWatermark/WatermarkTextStyle.tsx b/frontend/src/core/components/tools/addWatermark/WatermarkTextStyle.tsx index b4a1dcd3d..e0aa22a7b 100644 --- a/frontend/src/core/components/tools/addWatermark/WatermarkTextStyle.tsx +++ b/frontend/src/core/components/tools/addWatermark/WatermarkTextStyle.tsx @@ -2,6 +2,7 @@ import { Stack, Text, Select, ColorInput } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { AddWatermarkParameters } from "@app/hooks/tools/addWatermark/useAddWatermarkParameters"; import { alphabetOptions } from "@app/constants/addWatermarkConstants"; +import { Z_INDEX_AUTOMATE_DROPDOWN } from "@app/styles/zIndex"; interface WatermarkTextStyleProps { parameters: AddWatermarkParameters; @@ -24,6 +25,7 @@ const WatermarkTextStyle = ({ parameters, onParameterChange, disabled = false }: onChange={(value) => onParameterChange("customColor", value)} disabled={disabled} format="hex" + popoverProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> @@ -36,6 +38,7 @@ const WatermarkTextStyle = ({ parameters, onParameterChange, disabled = false }: onChange={(value) => value && onParameterChange("alphabet", value)} data={alphabetOptions} disabled={disabled} + comboboxProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> diff --git a/frontend/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx b/frontend/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx index 104be7faa..5e2e0aa78 100644 --- a/frontend/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx +++ b/frontend/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx @@ -1,6 +1,7 @@ import { Stack, NumberInput, Select } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { AdjustPageScaleParameters, PageSize } from "@app/hooks/tools/adjustPageScale/useAdjustPageScaleParameters"; +import { Z_INDEX_AUTOMATE_DROPDOWN } from "@app/styles/zIndex"; interface AdjustPageScaleSettingsProps { parameters: AdjustPageScaleParameters; @@ -47,6 +48,7 @@ const AdjustPageScaleSettings = ({ parameters, onParameterChange, disabled = fal }} data={pageSizeOptions} disabled={disabled} + comboboxProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }} /> ); diff --git a/frontend/src/core/components/tools/automate/IconSelector.tsx b/frontend/src/core/components/tools/automate/IconSelector.tsx index 3b7733cf0..0bfcd01d8 100644 --- a/frontend/src/core/components/tools/automate/IconSelector.tsx +++ b/frontend/src/core/components/tools/automate/IconSelector.tsx @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next"; import { Box, Text, Stack, Button, SimpleGrid, Tooltip, Popover } from "@mantine/core"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import { iconMap, iconOptions } from '@app/components/tools/automate/iconMap'; +import { Z_INDEX_AUTOMATE_DROPDOWN } from '@app/styles/zIndex'; interface IconSelectorProps { value?: string; @@ -36,6 +37,8 @@ export default function IconSelector({ value = "SettingsIcon", onChange, size = position="bottom-start" withArrow trapFocus + withinPortal + zIndex={Z_INDEX_AUTOMATE_DROPDOWN} >