Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Always keep the Viewer modal behind the others #686

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/components/Viewer/FilesViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const styleStatusBar = switcher => {
}
}

// Keep the Dialog behind the others Dialogs
const viewerStyle = { zIndex: 'calc(var(--zIndex-modal) - 1)' }

const FilesViewer = ({ filesQuery, files, fileId, onClose, onChange }) => {
const [currentFile, setCurrentFile] = useState(null)
const [fetchingMore, setFetchingMore] = useState(false)
Expand Down Expand Up @@ -122,6 +125,12 @@ const FilesViewer = ({ filesQuery, files, fileId, onClose, onChange }) => {

return (
<Viewer
componentsProps={{
modalProps: {
open: true,
style: viewerStyle
}
}}
files={viewerFiles}
currentIndex={viewerIndex}
onChangeRequest={handleOnChange}
Expand Down
4 changes: 0 additions & 4 deletions src/components/Views/InformationEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import Spinner from 'cozy-ui/transpiled/react/Spinner'
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

// Keep the Dialog above the Viewer
const fixedDialogStyle = { zIndex: 'var(--zIndex-modal-footer)' }

const InformationEdit = () => {
const { fileId } = useParams()
const client = useClient()
Expand Down Expand Up @@ -112,7 +109,6 @@ const InformationEdit = () => {
<FixedDialog
open
onClose={onClose}
style={fixedDialogStyle}
title={dialogTitle}
content={
<div
Expand Down
Loading