Added support for auto expand (JS)