diff --git a/awx/ui/client/lib/components/form/form.directive.js b/awx/ui/client/lib/components/form/form.directive.js
index 17b781debc..e2e2e746a4 100644
--- a/awx/ui/client/lib/components/form/form.directive.js
+++ b/awx/ui/client/lib/components/form/form.directive.js
@@ -38,6 +38,10 @@ function AtFormController (eventService, strings) {
component.category = category;
component.form = vm.state;
+ if (category === 'input') {
+ scope.state[component.state.id] = component.state;
+ }
+
vm.components.push(component);
};
@@ -189,6 +193,7 @@ function AtFormController (eventService, strings) {
for (let j = 0; j < vm.components.length; j++) {
if (components[i] === vm.components[j].state) {
vm.components.splice(j, 1);
+ delete scope.state[components[i].id];
break;
}
}
diff --git a/awx/ui/client/lib/components/input/base.controller.js b/awx/ui/client/lib/components/input/base.controller.js
index 13fa825a5d..5c27d903f0 100644
--- a/awx/ui/client/lib/components/input/base.controller.js
+++ b/awx/ui/client/lib/components/input/base.controller.js
@@ -85,9 +85,7 @@ function BaseInputController (strings) {
vm.updateValidationState(result);
};
- vm.toggleRevertReplace = () => {
- scope.state._isBeingReplaced = !scope.state._isBeingReplaced;
-
+ vm.onRevertReplaceToggle = () => {
if (!scope.state._isBeingReplaced) {
scope.state._buttonText = vm.strings.get('REPLACE');
scope.state._disabled = true;
diff --git a/awx/ui/client/lib/components/input/text.directive.js b/awx/ui/client/lib/components/input/text.directive.js
index e8d514fc7e..d28f4c2640 100644
--- a/awx/ui/client/lib/components/input/text.directive.js
+++ b/awx/ui/client/lib/components/input/text.directive.js
@@ -14,10 +14,14 @@ function atInputTextLink (scope, element, attrs, controllers) {
function AtInputTextController (baseInputController) {
const vm = this || {};
- vm.init = (scope, element, form) => {
- baseInputController.call(vm, 'input', scope, element, form);
+ let scope;
+
+ vm.init = (_scope_, element, form) => {
+ baseInputController.call(vm, 'input', _scope_, element, form);
+ scope = _scope_;
vm.check();
+ scope.$watch('state._value', () => vm.check());
};
}
diff --git a/awx/ui/client/lib/components/input/text.partial.html b/awx/ui/client/lib/components/input/text.partial.html
index c5140df834..8a1a22137e 100644
--- a/awx/ui/client/lib/components/input/text.partial.html
+++ b/awx/ui/client/lib/components/input/text.partial.html
@@ -8,7 +8,6 @@
ng-attr-maxlength="{{ state.max_length || undefined }}"
ng-attr-tabindex="{{ tab || undefined }}"
ng-attr-placeholder="{{::state._placeholder || undefined }}"
- ng-change="vm.check()"
ng-disabled="state._disabled || form.disabled" />