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

[Bug]: web viewer style for [hidden] not work correctly #18704

Closed
zhaojjiang opened this issue Sep 7, 2024 · 2 comments · Fixed by #18707
Closed

[Bug]: web viewer style for [hidden] not work correctly #18704

zhaojjiang opened this issue Sep 7, 2024 · 2 comments · Fixed by #18707
Labels

Comments

@zhaojjiang
Copy link

zhaojjiang commented Sep 7, 2024

Attach (recommended) or Link to PDF file

any

Web browser and its version

any

Operating system and its version

any

PDF.js version

4.6.82

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

when i add [hidden] to web/viewer.html, some button not hide correctly,

<button id="secondaryPrint" class="toolbarButton labeled visibleMediumView" type="button" title="Print" tabindex="52" data-l10n-id="pdfjs-print-button" hidden>
  <span data-l10n-id="pdfjs-print-button-label">Print</span>
</button>

<button id="secondaryDownload" class="toolbarButton labeled visibleMediumView" type="button" title="Save" tabindex="53" data-l10n-id="pdfjs-save-button" hidden>
  <span data-l10n-id="pdfjs-save-button-label">Save</span>
</button>

style

.hidden,
[hidden] {
  display: none !important;
}

overwrite by

@media all and (max-width: 750px) {
  :root {
    --editor-toolbar-base-offset: 40px;
  }
  #outerContainer .hiddenMediumView {
    display: none !important;
  }
  #outerContainer .visibleMediumView {
    display: inherit !important;
  }
}

What is the expected behavior?

[hideden] should have highest priority

What went wrong?

[hidden] not work for some elements

Link to a viewer

No response

Additional context

No response

@zhaojjiang zhaojjiang changed the title [Bug]: style for [hidden] not work correctly [Bug]: web viewer style for [hidden] not work correctly Sep 7, 2024
@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Sep 7, 2024

Given that this appears to be relevant to a custom implementation, it's unfortunately not clear to me that it's a good use of our time to attempt to fix this (since any patch would require a fair amount of manual testing to ensure that nothing else breaks).

@zhaojjiang
Copy link
Author

zhaojjiang commented Sep 8, 2024

  • add hidden class/attribute is the only way or easiest way to hide some menu button.
  • this way works fine with last version (v4.5.136). Maybe changed by Remove the secondaryToolbarButton CSS class #18596 , but it affects only some buttons, such as secondary print/download button. I'm not sure if this change works as expected or not.

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