Skip to content

#4057 Drop-down menus are not shown if add Ketcher to dialog#9827

Closed
guliaisaeva wants to merge 26 commits into
masterfrom
fix-dropdown-menu-visibility
Closed

#4057 Drop-down menus are not shown if add Ketcher to dialog#9827
guliaisaeva wants to merge 26 commits into
masterfrom
fix-dropdown-menu-visibility

Conversation

@guliaisaeva
Copy link
Copy Markdown
Collaborator

@guliaisaeva guliaisaeva commented Apr 21, 2026

Description:
Restores correct dropdown stacking in dialogs by removing the custom z-index override from the dialog root. This lets MUI’s default z-index system handle dialog and dropdown layering, ensuring dropdown menus (Select, Popover, etc.) always appear above dialogs as intended. No functional regressions; all tests pass.

@guliaisaeva guliaisaeva linked an issue Apr 21, 2026 that may be closed by this pull request
@AlexeyGirin
Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

…pdown-menu-visibility

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflict in Select.tsx (commit 284b02d). The conflict combined master's refactored options.find() for currentValue (removing the useState/useEffect overhead) while preserving our KETCHER_ROOT_NODE_CSS_SELECTOR portal container fix that ensures dropdown menus appear above dialogs.

AlexeyGirin and others added 4 commits April 29, 2026 15:49
Co-authored-by: Copilot <copilot@github.com>
…pdown-menu-visibility

# Conflicts:
#	ketcher-autotests/tests/specs/Chromium-popup/Bugs/ketcher-3.11.0-bugs.spec.ts-snapshots/Bugs-ketcher-3-11-0-—-first-trio-Case-35---System-adds-broken-Preset-to-the-library-part2-2-chromium-popup-linux.png
#	ketcher-autotests/tests/specs/Chromium-popup/Library/color-of-nucleobases.spec.ts-snapshots/Color-of-Nucleobases-Case-2-Check-that-All-nu-540f3-their-colour-changed-to-FFE97B-see-mockups-1-chromium-popup-linux.png
#	ketcher-autotests/tests/specs/Chromium-popup/Library/color-of-nucleobases.spec.ts-snapshots/Color-of-Nucleobases-Case-2-Check-that-All-nu-8d479-their-colour-changed-to-FF973C-see-mockups-1-chromium-popup-linux.png
#	ketcher-autotests/tests/specs/File-Management/Open-And-Save-Files/CDX-Files/cdx-files.spec.ts-snapshots/CDX-files-opening-cdx-files-from-clipboard-1-chromium-linux.png
#	ketcher-autotests/tests/specs/File-Management/Open-And-Save-Files/PPTX-Files/pptx-files.spec.ts-snapshots/PPTX-files-User-can-import-canvas-with-50-big-molecules-from-pptx-file-1-chromium-linux.png
#	ketcher-autotests/tests/specs/File-Management/Open-And-Save-Files/PPTX-Files/pptx-files.spec.ts-snapshots/PPTX-files-User-can-import-from-pptx-file-wit-595e5--basic-ChemDraw-15-0-object-Geometry-figures-1-chromium-linux.png
#	ketcher-autotests/tests/specs/File-Management/Open-And-Save-Files/PPTX-Files/pptx-files.spec.ts-snapshots/PPTX-files-User-can-import-from-pptx-file-wit-ad30f-asic-ChemDraw-15-0-object-Pluses-and-minuses-1-chromium-linux.png
#	ketcher-autotests/tests/test-data/Molfiles-V3000/Bugs/4aPEGMal-expected.mol
#	ketcher-autotests/tests/test-data/Molfiles-V3000/Bugs/DnaBadPairs-expected.mol
#	ketcher-autotests/tests/test-data/SDF/All type of monomers in horisontal chain and large micromolecule in the middle-expected.sdf
#	ketcher-autotests/tests/test-data/SDF/Saving monomers to SDF v300o works wrong-expected.sdf
#	ketcher-autotests/tests/test-data/SDF/rdf-rxn-v2000-reaction-3x3-new-expected.sdf
#	packages/ketcher-react/src/script/ui/component/form/Select/Select.tsx
…m/ketcher into fix-dropdown-menu-visibility

# Conflicts:
#	ketcher-autotests/tests/specs/File-Management/Open-And-Save-Files/PPTX-Files/pptx-files.spec.ts-snapshots/PPTX-files-User-can-import-canvas-with-50-big-molecules-from-pptx-file-1-chromium-linux.png
@AlexeyGirin AlexeyGirin changed the title #4057-fixed Drop-down menus are not shown if add Ketcher to dialog #4057 Drop-down menus are not shown if add Ketcher to dialog May 4, 2026
@AlexeyGirin
Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

…pdown-menu-visibility

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts in commit d0d01f4. Two files had conflicts:

  • PNG snapshot (ketcher-3.10.0-bugs): used master's version
  • mol-1848-to-compare-expectedV2000.mol: used master's version (header timestamp difference)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses dropdown (MUI Select/Popover) stacking issues when Ketcher is embedded inside dialogs by adjusting how dropdown portals are attached and by removing/reducing custom z-index interference so MUI’s z-index layering can work as intended.

Changes:

  • Updated the Select component to portal its dropdown content into the Ketcher root node.
  • Added per-instance editor theming support (theme class on the editor root and a useEditorTheme hook) to support isolated styling when multiple editors are present.
  • Updated example styling/config and refreshed several autotest SDF fixtures (Indigo header lines) as part of test baselines.

Reviewed changes

Copilot reviewed 164 out of 180 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/ketcher-react/src/script/ui/component/form/Select/Select.tsx Changes dropdown portal container selection to target the Ketcher root.
packages/ketcher-react/src/script/ui/MicromoleculesEditor.tsx Assigns a stable .Ketcher-root class and theme class to the editor root wrapper.
packages/ketcher-react/src/script/ui/Ketcher.tsx Applies theme class to the Ketcher container (supports per-instance styling).
packages/ketcher-react/src/script/ui/hooks/useEditorTheme.ts Introduces hook to determine editor theme class.
packages/ketcher-react/src/script/ui/styles/main.less Styles updated to accommodate the new root/theme class structure.
example/src/index.css Adjusts example app styling related to editor container z-index/positioning.
example/package.json Updates example dev server configuration (port).
ketcher-autotests/playwright.config.ts Adjusts Playwright config for updated runtime environment/ports.
packages/ketcher-react/src/script/ui/tests/KetcherPPTXExport.test.tsx Test import adjustments for utilities.
ketcher-autotests/tests/test-data/SDF/*.sdf Refreshes Indigo-generated header lines in multiple SDF fixtures.

Comment on lines +68 to +70
const portalContainer =
document.querySelector<HTMLElement>(KETCHER_ROOT_NODE_CSS_SELECTOR) ||
undefined;
Comment thread example/src/index.css
Comment on lines +34 to 38
max-height: calc(100vh - 4.28571rem);
max-width: calc(100vw - 4.28571rem);
min-height: 19rem;
min-width: 19rem;
}
@svvald svvald deleted the fix-dropdown-menu-visibility branch May 19, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop-down menus are not shown if add Ketcher to dialog

4 participants