completed basic autocomplete directive