ngx-extended-pdf-viewer icon indicating copy to clipboard operation
ngx-extended-pdf-viewer copied to clipboard

Icons not visible on high contrast mode

Open PatrickZimmerer opened this issue 10 months ago • 9 comments

Describe the bug The Icons in the Toolbar are not visible in high contrast mode in our application, this bug is not on the demo page and not in the Mozilla pdf.js demo, this is just a question if this get's fixed by updating angular & ngx extended pdf viewer to a more current version. So this is not a really a bug I just am curious if there is anything we can do to resolve this bug without the need of updating angular / pdf viewer.

Version info

  • Angular 15
  • NGX-Extended-Pdf-Viewer: 18.1.14

Demonstration of the problem We have a custom toolbar and the component is reusable, this is how we use it:

Bildschirmfoto 2024-03-26 um 09 34 30

This vests that view:

Bildschirmfoto 2024-03-26 um 09 35 52

Using the code from the demo page:

Bildschirmfoto 2024-03-26 um 09 36 25 Vests this view:

Bildschirmfoto 2024-03-26 um 09 36 31

PatrickZimmerer avatar Mar 26 '24 12:03 PatrickZimmerer

Someone thought it's a good idea to make every element black by default through the *{} selector in CSS, so you can delete this

PatrickZimmerer avatar Mar 26 '24 12:03 PatrickZimmerer

Funny enough I found out that the draw editor icon is not visible on your pdfviewer demo page, but is visible in the pdf.js demo (only in high contrast mode), this error also occurs in our project

PatrickZimmerer avatar Mar 26 '24 12:03 PatrickZimmerer

In version 19.5.0, the icons weren't rendered not at all. I've fixed this in version 19.5.1. So let me double-check: you do see the icons unless you activate high-contrast mode?

Generally speaking, I believe accessibility is important, so I'm always happy when someone opens a ticket to improve it. I'm too busy to test accessibility actively, so I reluctantly rely on the community to nudge me into the right direction. In other words, thank you for opening this ticket!

stephanrauh avatar Mar 26 '24 22:03 stephanrauh

I do see the icon, but when activating high-contrast mode it disappears, this holds true on my end and on your pdf viewer preview page, on Mozilla's pdf.js preview this is fixed, the "draw" icon is visible there.

PatrickZimmerer avatar Apr 02 '24 09:04 PatrickZimmerer

How do I activate high contrast mode?

stephanrauh avatar Apr 06 '24 21:04 stephanrauh

This is a windows specific feature afaik, just search in the searchbar for High / High Contrast

PatrickZimmerer avatar Apr 10 '24 21:04 PatrickZimmerer

At the moment, I don't have a Windows machine. I think that'll change in roughly four weeks, but until then, I have to let you down. I hate that, but there's nothing I can do about it.

On the other hand, I believe (or hope?) it's just a stupid CSS issue. You should be able to override the offending CSS rule in your global styles.(s)css file, and once you've managed to solve the issue that way, you can either send me a pull request or send me your workaround. I know I'm nasty - you're asking for help and me answer is "do it yourself!", so I ask you to bear with me. On the plus side, that's the beauty of open source development: you're sitting in the driver seat. OK, let's stick to the truth: I'm sitting in the driver seat, but you're an important copilot, and I'm listening to you!

stephanrauh avatar Apr 25 '24 21:04 stephanrauh

I have played around a little, by adding: fill = currentColor; to the SVG which sits inside the button element id="primaryEditorInk" so all other svgs have a path with the attribute fill="currentColor" but this one doesn't have it

After adding the draw icon appears in the same color as all the other icons in both, the normal contrast and the high contrast mode

PatrickZimmerer avatar Apr 30 '24 11:04 PatrickZimmerer

Awesome, thanks! Most likely, I'm going to publish the next version after Pentecost, so I'm afraid you have to wait a short while. Apart from that, consider it done!

stephanrauh avatar May 04 '24 16:05 stephanrauh

Actually, I've found the button missing the fill property. Please check my latest commit. Does it look sensible to you?

I intend to publish the bug fix this week-end. That's probably before you've got an opportunity to double-check it, but even so, thanks for your patience. It took a while to solve the issue!

stephanrauh avatar May 24 '24 20:05 stephanrauh

Your bugfix has landed with version 20.2.0.

Enjoy Stephan

stephanrauh avatar May 25 '24 12:05 stephanrauh