Connecter une souris USB à un Macbook - un Bug bizarre

04 mai 2016 / Marouen Mhiri / General

This is a small story which happens to us while working on a project and I found that very funny (of course after we realized how to fix the problem :-)) and I only want to share it with you. May be someone else will encounter it.

So This the use case :
* When connecting an USB mouse (and only USB) to a Macbook, the browser shows the scrollbar of the browser window. This lead to a buggy responsive behaviour of the page.

We searched in our Code and found out that document.documentElement.clientWidth is used. And because this clientWidth adds the scrollbar width to the body width, this generated a bug (because some functions depends on this clientWidth).

Interesting is that a magic mouse doesn't make any changes to the browser when connected 🙂

Tags :

screenviewport