Fixed autoclose not working on non-input elements