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

PDF-viewer not full-screen anymore on NC28 #843

Closed
szaimen opened this issue Oct 25, 2023 · 2 comments · Fixed by #845
Closed

PDF-viewer not full-screen anymore on NC28 #843

szaimen opened this issue Oct 25, 2023 · 2 comments · Fixed by #845

Comments

@szaimen
Copy link
Collaborator

szaimen commented Oct 25, 2023

@danxuliu I tested this and it works fine generally but I don't know why and if it is caused by this PR but somehow the pdf viewer has two scrollbars now:
image

Reproduced on NC28

Originally posted by @szaimen in #787 (review)

@danxuliu
Copy link
Member

Strangely enough I have not been able to reproduce the double scroll bar issue, but it should be caused by the same change that made the PDF viewer to no longer be shown in full screen. Maybe it depends on the PDF file, I do not know 🤷

In any case, the problem is that, although the viewer is "framed" and leaves a small space at the bottom, the iframe of the PDF viewer overflows it and uses the full height of the viewer (leaving a margin at the top for the header). However, in Nextcloud 28, NcModal sets overflow: auto to its content, so the PDF viewer is now clipped at the bottom and no longer overflows (but shows a scroll bar).

Note that overflow: auto has been set already in the NcModal container for several versions before adding the content element and moving the rule to it, and the PDF viewer was working fine. The reason is that the viewer overrides the property with overflow: visible for the NcModal container and the content of the viewer. However, as overflow: auto is now set in the NcModal content, which is an intermediate element between the NcModal container and the viewer content, the PDF viewer ends clipped, as .viewer__content is already clipped by .modal-container__content:

<div class="modal-container".../> <!-- "overflow: visible !important" from Viewer.vue -->
  <div class="modal-container__content".../> <!-- "overflow: auto" from NcModal.vue -->
    <div class="viewer__content".../> <!-- "overflow: visible !important" from Viewer.vue -->

Setting overflow: visible !important for .modal-container__content in PDFView.vue is not possible as far as I know, as the component is loaded inside the content itself, and therefore it can not modify the rules of the parent element (but I might be wrong, my Vue-fu is quite rusty :-) ). However, I do not know if overriding that in the viewer itself like done for the others would be a good idea, as that change was introduced to ensure that the close button of the modal is visible even if the content is scrolled, and if the overflow is visible I guess that could bring back the issue. On the other hand, that would happen only in the viewer, other modals would not be affected, and maybe it could be required that viewer handlers are responsible to handle the scrolling to ensure that it only affects its own content. Or maybe there is another solution that I am missing, of course :-)

@szaimen
Copy link
Collaborator Author

szaimen commented Nov 1, 2023

Adjusted #845. Should work now without any viewer fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants