Font-Awesome icon indicating copy to clipboard operation
Font-Awesome copied to clipboard

Zooming on Safari does not scale svg icons

Open ghost opened this issue 6 years ago • 21 comments

Describe the problem

Go to any examples of the svg icons and zoom in and out in Safari (https://fontawesome.com/how-to-use/svg-with-js for instance) -- the icons do not scale.

What did you expect?

SVG icons to scale with browser zoom.

What version and implementation are you using?

Version: Browser and version: Safari 11.1, macOS High Sierra

  • [x] SVG with JS
  • [ ] Web Fonts with CSS
  • [ ] SVG Sprites
  • [ ] On the Desktop

Reproducible test case

https://fontawesome.com/how-to-use/svg-with-js

ss

ghost avatar May 03 '18 23:05 ghost

Hi!

Thanks for being part of the Font Awesome Community.

image

Cannot replicate on iOS 11.3.1. Could you please provide all the information required by our bug report template, including OS?

Please make sure that your request follows our bug report template

Meanwhile, closing here

tagliala avatar May 04 '18 08:05 tagliala

Updated the OP.

ghost avatar May 04 '18 08:05 ghost

No issues with pinch-to-zoom: image

There seems to be issue with CMD++

I need to investigate on this

tagliala avatar May 04 '18 10:05 tagliala

@SeriousLemon thanks for reporting this, I can confirm

I have a reduced test case without font awesome, I don't know if this could be considered a browser bug: https://jsfiddle.net/tagliala/f1Ljqk5b/3/

The problem is in the font-size: inherit property of .svg-inline--fa which is preventing Safari from scaling up icons.

@robmadole what is the purpose of that css rule on an <svg> element?

tagliala avatar May 04 '18 12:05 tagliala

It's to ensure that we inherit the computed font-size from the parent. This sounds like a Safari bug to me.

robmadole avatar May 14 '18 17:05 robmadole

We're running into this same problem. Has anyone filed a bug report with Apple that we can dupe?

winzig avatar Aug 17 '18 00:08 winzig

@winzig I have a reduced test case without Font Awesome: https://jsfiddle.net/tagliala/f1Ljqk5b/3/

tagliala avatar Aug 17 '18 11:08 tagliala

I've filed a bug report with Apple (rdar://43425312). You can view the open radar version of it here: https://openradar.appspot.com/radar?id=5024734567727104

It would help them prioritize this issue if everyone here that has an Apple dev account could dupe the bug report. Using Brisk makes it very easy. There's a menu option to "Duplicate Radar":

screen shot 2018-08-17 at 8 49 42 am

Then you just enter "43425312", it pre-fills my report, and you can either just submit it or add your own comments. (Yes, unbelievably this is how they prefer to prioritize bug reports!)

To install Brisk from Terminal:

brew cask install Brisk

You'll then find it in your Applications folder.

If you don't have brew installed, refer to the brew page.

winzig avatar Aug 17 '18 15:08 winzig

Oh and thanks to @tagliala: I referenced your test case in the report.

winzig avatar Aug 17 '18 15:08 winzig

Still not fixed in Safari 14...

nortonandreev avatar Jun 28 '20 01:06 nortonandreev

Sad that it's still an issue. Quite a while ago one of the Safari devs recommended I report the bug via webkit.org so I did at that time, here it is: https://bugs.webkit.org/show_bug.cgi?id=199236

winzig avatar Jun 28 '20 17:06 winzig

I reported it via the Feedback Assistant yesterday and for similar reports it says “More than 10”. It might be useful if people who have Apple Developer account report it via the Feedback Assistant too.

nortonandreev avatar Jun 28 '20 22:06 nortonandreev

Still an issue on Safari :(

apoorvkk avatar Jan 13 '21 14:01 apoorvkk

Still an issue for me too. Commenting to see if it gives this bug some traction.

tannersatch avatar Jan 25 '21 23:01 tannersatch

I have custom svg + text wapped by clippath and zoom in/out doesnt scale it.

Viktor19931 avatar Mar 17 '21 13:03 Viktor19931

Do you have ways to fix this locally? I have same issue.

Postamentovich avatar Nov 20 '21 09:11 Postamentovich

60C4E1C7-C096-4A4E-8ACE-FFD4968439E1

I reported it to Apple last year, but it still hasn’t been resolved…

nortonandreev avatar Nov 20 '21 14:11 nortonandreev

This seems to be now fixed with FontAwesome 6! 🎉(Happy Release Day, btw)

If you still want to use FontAwesome 5, updating the fontawesome-svg-core to 1.3.0 and fontawesome-common-types to 0.3.0 fixed the issue for me. It seems to be working, but a confirmation from the FontAwesome team that these versions of these packages are fully compatible with 5.15.4 would be nice (although I am not seeing any issues).

Screenshot 2022-02-07 at 23 09 54

nortonandreev avatar Feb 07 '22 21:02 nortonandreev

Can confirm this icon not scaling on zooming issue still occur in Safari 15.2

blairzhao111 avatar Apr 18 '22 02:04 blairzhao111

Ignore my comment from a few minutes ago, the icons that were not working in FA6 had an fa-sm style attached to them. Without that, it's working! Perhaps this is still considered a bug, but at least I know why it wasn't fully working.

Looks like the issue here is the font-size style on the fa-sm, fa-lg, etc classes. Not sure if that means it's still a Safari bug, or what. We'll need to figure out a work-around to achieve the sizing of those classes without overriding the ability to let safari resize the icons when zooming?

winzig avatar Jul 18 '22 23:07 winzig

Hi,

Not sure if that means it's still a Safari bug

This is a reproducible test case without Font Awesome: https://jsfiddle.net/tagliala/f1Ljqk5b/3/

tagliala avatar Jul 19 '22 07:07 tagliala