Add shown/hidden events, fix test, update doc