C
C
Captain Cocoa2019-12-22 17:28:39
css
Captain Cocoa, 2019-12-22 17:28:39

Why is text inside foreignObject not displayed in Safari browser?

Hello everyone, there is an animation of the graph - demo
Everything works well, but if you open this case in mobile Safari, then the animation works partially.
The line and dots appear on it, but the names of the months do not.
The problem is only in Safari. Who knows how to solve the problem and what is it in general?
Link to view the result in full screen on the phone - jsfiddle.net/eg8ps619/5/embedded/result/dark#Result

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashenka, 2019-12-22
@like-a-boss

Hello, I tried a lot of things: namespaces for divs, x, y, width, heigh attributes for foreignObject, two mobile versions of safari, etc., but only by specifying position: fixedfor months I managed to show them. When debugging, it is clear that the months are in their places, they are just not visible. This, of course, does not claim to be a solution. If I were you, I would do this without using svg at all. Or try without foreignObject, using svg elements like text. Safari is hopeless

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question