sunsynk-power-flow-card icon indicating copy to clipboard operation
sunsynk-power-flow-card copied to clipboard

MDI icons wrong size and position in Safari

Open slipx06 opened this issue 1 year ago • 7 comments

There is an issue with the way Safari renders the foreignObject element which I use to display the mdi icons. This affects their position and size. I don't know how to fix this so for now the work around is to use another browser or use the built in icon presets.

slipx06 avatar Jul 02 '23 13:07 slipx06

@slipx06 is this only happening for safari? Any other browsers like brave, firefox etc? I don't own apple products so cannot reproduce

Pho3niX90 avatar Nov 12 '23 08:11 Pho3niX90

@Pho3niX90 only seems to be a problem with Safari

https://stackoverflow.com/questions/51313873/svg-foreignobject-not-working-properly-on-safari https://discussions.apple.com/thread/254680843

slipx06 avatar Nov 12 '23 17:11 slipx06

@slipx06 it seems this might be related to safari 16.3? https://discussions.apple.com/thread/254680843

Pho3niX90 avatar Nov 12 '23 18:11 Pho3niX90

I will see if I can maybe emulate safari

Pho3niX90 avatar Nov 12 '23 18:11 Pho3niX90

Im on Safari 16.6.1 and the Card looks good to me? But maybe my config doesn't have a lot of icons for it to be a "mess"? Screenshot 2023-11-14 at 08 12 17

Happy to try a config that someone is having an issue with and see if its fine in 16.6.1?

finch6 avatar Nov 14 '23 06:11 finch6

Thanks. It only becomes a problem if you are using mdi icons in the card. In other words load1_icon: mdi: example etc

I think there must be a better way of rendering the icon inside the SVG. I'll also take another look

slipx06 avatar Nov 14 '23 07:11 slipx06

Maybe all webkit, not just Safari. I get the same problem when using the HomeAssistant 'app' on a Mac. Looks just like in Firefox, except the icon for the EV charger is small!

(screenshot from Safari)

in_safari

lamixer avatar Dec 03 '23 12:12 lamixer