You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble with this same problem.
Currently, I am using this module to separate the loading of css by user-agent, but if ipad of chrome, both is_tablet and is_mobile returned true, so both css are loaded and corrupted.
Any help is welcome.
Thank you.
Currently, both iPad Air and iPad mini return "true" for both is_mobile and is_tablet.
Due to this situation, although I made CSS file separated mobile and tablet, both css loaded.
Regarding this issue, I was able to solve it with the following code.
{% if request.user_agent.is_mobile and 'iPad' not in request.user_agent.device %}
<linkrel="stylesheet" href="{% static 'css/custom-style-sp.css' %}">
{% endif %}
{% if request.user_agent.is_tablet %}
<linkrel="stylesheet" href="{% static 'css/custom-style-tablet.css' %}">
{% endif %}
In the above code, ipad air and ipad mini will only be true for the tablet and only the code for the tablet will be loaded.
(I'm only validating with chrome's dev tool.)
On Chrome for Ipad the method is_mobile and is_tablet returns True for both cases.
Is this normal? Shouldn't it return False for mobile?
Are there any other known situations where mobile and tablet both return True?
Thanks!
The text was updated successfully, but these errors were encountered: