mirror of
https://github.com/nasa/openmct.git
synced 2025-04-08 11:54:25 +00:00
[Autocomplete] Show warning icon if invalid option was typed
This commit is contained in:
parent
504b2e1ecf
commit
307320b3ff
@ -329,6 +329,13 @@ textarea.lg { position: relative; height: 300px; }
|
||||
color: $colorInspectorSectionHeaderFg;
|
||||
}
|
||||
}
|
||||
.autocompleteWarning {
|
||||
color: $colorFormInvalid;
|
||||
position: absolute;
|
||||
font-size: 11px;
|
||||
left: 235px;
|
||||
bottom: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************** OBJECT-HEADER */
|
||||
|
@ -26,6 +26,7 @@
|
||||
type="text"
|
||||
ng-model="ngModel[field]"
|
||||
ng-change="filterOptions(ngModel[field])"
|
||||
ng-init="filterOptions(ngModel[field])"
|
||||
ng-click="inputClicked()"
|
||||
ng-keydown="keyDown($event)"/>
|
||||
<span class="icon-arrow-down"
|
||||
@ -43,4 +44,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<span class="icon-x autocompleteWarning"
|
||||
ng-show="invalidOption">
|
||||
</span>
|
||||
</div>
|
@ -111,6 +111,7 @@ define(
|
||||
name: option
|
||||
};
|
||||
});
|
||||
$scope.invalidOption = $scope.filteredOptions.length === 0;
|
||||
};
|
||||
|
||||
$scope.inputClicked = function () {
|
||||
|
@ -53,6 +53,11 @@ define([
|
||||
expect(mockScope.filteredOptions).toEqual(filteredOptions);
|
||||
});
|
||||
|
||||
it("checks if invalid option was typed", function () {
|
||||
mockScope.filterOptions('openmct');
|
||||
expect(mockScope.invalidOption).toEqual(true);
|
||||
});
|
||||
|
||||
it("fills input with given string", function () {
|
||||
var str = "UTC";
|
||||
mockScope.fillInput(str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user