Autocomplete : add class to body when autocomplete is open

What is the best way to add a css class to body when autocomplete is open ?
With onStateChange, it seems that this event is triggered many times…