Skip to content

Commit

Permalink
Merge pull request #35 from uncountableinc/brendan/fix-fullscreen-zoom
Browse files Browse the repository at this point in the history
Fix fullscreen zoom
  • Loading branch information
leb2 authored Dec 10, 2024
2 parents 7cb6ad7 + 5cd14e0 commit 1b4a793
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ketcher-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-core",
"version": "2.24.0-rc.1-unc33",
"version": "2.24.0-rc.1-unc34",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
2 changes: 1 addition & 1 deletion packages/ketcher-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-react",
"version": "2.24.0-rc.1-unc33",
"version": "2.24.0-rc.1-unc34",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ import { Button, Popover } from '@mui/material';
import { zoomList } from 'src/script/ui/action/zoom';
import { ZoomInput, updateInputString } from './ZoomInput';
import { Icon } from 'components';
import { KETCHER_ROOT_NODE_CSS_SELECTOR } from 'src/constants';

const isFullScreen = () => {
return !!(
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement ||
document.msFullscreenElement
);
};

const ElementAndDropdown = styled('div')`
position: relative;
Expand Down Expand Up @@ -168,6 +178,12 @@ export const ZoomControls = ({
open={isExpanded}
onClose={onClose}
anchorEl={containerRef.current}
container={
isFullScreen()
? containerRef.current?.closest(KETCHER_ROOT_NODE_CSS_SELECTOR) ??
document.body
: undefined
}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'left',
Expand Down

0 comments on commit 1b4a793

Please sign in to comment.