Override the $InputWithFrame.__checkCfgConsistency in order to check the invalidText and restore the error
state if needed.
@protected
@override
1204
function () {
            this.$InputWithFrame._checkCfgConsistency.call(this);

            var cfg = this._cfg;

            if (cfg.autoselect == null) {
                // the default value for autoselect comes from the environment
                cfg.autoselect = ariaWidgetsEnvironmentWidgetSettings.getWidgetSettings().autoselect;
            }

            var value = cfg.value;
            if (cfg.invalidText) {
                // Check the field depending on the value and the existing error
                var rep = this.checkValue({
                    text : cfg.invalidText,
                    value : value,
                    performCheckOnly : true
                });
                if (!rep.isValid) {
                    if (cfg.directOnBlurValidation) {
                        this.changeProperty("error", true);
                    }
                    // Just to set the this._helpTextSet to true in this case,
                    // as the invalid text will be displayed:
                    value = cfg.invalidText;
                    this._helpTextSet = false;
                    if (rep.report) {
                        rep.report.$dispose();
                    }
                } else {
                    // for autocomplete, no report is raised. Asynchronous
                    // callback will set proper state
                    if (rep.report) {
                        this.changeProperty("error", false);
                        if (rep.report.text == null || rep.report.text === "") {
                            if (cfg.prefill && cfg.prefill + "") {
                                this._isPrefilled = true;
                            } else {
                                this._helpTextSet = cfg.helptext;
                            }
                        }
                        rep.report.$dispose();
                    }
                }
                this._setState();
            } else {
                // if the value is not set (namely it is null, undefined, an
                // empty string or an empty array) and the
                // prefill is defined
                if ((ariaUtilsType.isArray(value) && ariaUtilsArray.isEmpty(value)) || (!value && value !== 0)) {
                    if (cfg.prefill && cfg.prefill + "") {
                        this._isPrefilled = true;
                    } else {
                        this._helpTextSet = cfg.helptext;
                    }
                }
                if (this._isPrefilled) {
                    this._setState();
                }
            }

        }
594363
function InvalidDerefInputError() {
    var instance = new Error("Deref can only be used with a non-primitive object from get, set, or call.");

    instance.name = "InvalidDerefInputError";

    if (Object.setPrototypeOf) {
        Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
    }

    if (Error.captureStackTrace) {
        Error.captureStackTrace(instance, InvalidDerefInputError);
    }

    return instance;
}
498271
function() {
			var value = this.getTextInputValue();
			if (value) {
				var recentEntryArray = this.getRecentEntryArray();
				if (!recentEntryArray) {
					recentEntryArray = [];
				}
				
				var indexOfElement = this._getIndexOfValue(recentEntryArray, value); //check if a duplicate entry exists
				if (0 !== indexOfElement) {
					// element is either not in array, or not in first position
					if (-1 !== indexOfElement) {
						// element is in array, remove it because we want to add it to beginning
						recentEntryArray.splice(indexOfElement, 1);
					}
					
					//add new entry to beginning of array
					recentEntryArray.unshift({
						type: "proposal", //$NON-NLS-0$
						label: value, 
						value: value
					});
					this._storeRecentEntryArray(recentEntryArray);
					
					this._showRecentEntryButton();
				}
			}
		}
599116
private void checkRelaxed(String errorMessage) {
		if (!relaxed) {
			throw new KriptonRuntimeException(errorMessage, true, this.getLineNumber(), this.getColumnNumber(), getPositionDescription(), null);
		}
		if (error == null) {
			error = "Error: " + errorMessage;
		}
	}
201063
function accept(&$renderer, $required=false, $error=null)
    {
        $this->_text .= $this->getHelpButton();
        $renderer->renderHeader($this);
    }
894865
public static boolean checkContainsInvalidCharacter(String text, String invalidCharacters){
		if(text == null || text.trim().length() == 0 || invalidCharacters == null) return false;
		
		for (char c : invalidCharacters.toCharArray()) {
			if(text.indexOf(new String(new char[]{c})) >= 0) return true;
		}
		
		return false;
	}
486443
function validateInputAsJson() {
  if (this.value) {
    try {
      JSON.parse(this.value);
      setValidationClasses(this, true);
    }
    catch(e) {
      setValidationClasses(this, false);
    }
  }
  else {
    setValidationClasses(this, false)
  }
}
1330725
function () {
            this.$DropDownTextInput._checkCfgConsistency.call(this);
            var opt = this._cfg.options;
            var values = [];
            var dupValues = [];
            var map = {};

            for (var count = 0; count < opt.length; count++) {
                if (map[opt[count].value]) {
                    dupValues.push(opt[count].value);
                } else {
                    map[opt[count].value] = true;
                    values.push(opt[count]);
                }
            }
            if (dupValues.length > 0) {
                this.controller.setListOptions(values);
                this.$logError(this.DUPLICATE_VALUE, [dupValues]);
            }

        }
514269
protected void common_invalidate(Object key, boolean waitOnInvalidation, boolean checkPreInvalidationListener) {
        ValidateUtility.objectNotNull(key, "key");
        cache.invalidateById(key, waitOnInvalidation, checkPreInvalidationListener);
    }
846852
private function isValidTopElementStyle(string $topElementStyle): void
    {
        $allowedTopElementStyle = $this->getAllowedTopElementStyle();
        if (!\in_array($topElementStyle, $allowedTopElementStyle, true)) {
            throw new InvalidKeyException(sprintf(
                'topElementStyle must be either "%s".',
                implode(', ', $allowedTopElementStyle)
            ));
        }
    }
523017
function(key){
                                var func = $scope.utils.tryGetFunction($scope.jsonFn[key]);
                                func
                                    ? angular.element($scope.utils.textarea.element).removeClass('invalid').addClass('valid')
                                    : angular.element($scope.utils.textarea.element).removeClass('valid').addClass('invalid');
                            }
911937
private void setPlaceholderTextInternal(String text,
                                            @ColorInt int color,
                                            int textSize,
                                            boolean invalidate) {
        // Takes only the first character as the place holder
        mText = formatPlaceholderText(text);
        mTextColor = color;
        mTextSize = textSize;

        if ((null == mTextPaint) &&
            (textSize > 0) &&
            !TextUtils.isEmpty(mText)) {
            mTextPaint = getTextPaint();
        }

        if (null != mTextPaint) {
            mTextPaint.setColor(color);
            mTextPaint.setTextSize(textSize);
        }

        // Invalidate the view if asked
        if (invalidate) {
            invalidate();
        }
    }
975647
function () {
                this.$InputElement.initWidget.call(this);

                var bindings = this._cfg.bind;
                if (bindings.value) {
                    var newValue = this._transform(bindings.value.transform, bindings.value.inside[bindings.value.to], "toWidget");
                    if (newValue != null) {
                        this._domElt.value = newValue;
                    }
                } else {
                    this.$logWarn(this.BINDING_NEEDED, [this.$class, "value"]);
                }
                this._setPlaceholder();
            }
1326168
public void checkValid() {
        final StringBuilder b = new StringBuilder();
        if (precisionForFxRate < 2) {
            b.append("Precision for FX should be >=2");
        }
        if (precisionForInverseFxRate < 2) {
            if (b.length() > 0) {
                b.append(",");
            }
            b.append("Precision for 1/FX should be >=2");
        }
        if (ratesSnapshot.isEmpty() && baseFxRateProvider == null) {
            if (b.length() > 0) {
                b.append(",");
            }
            b.append("You must provide Base Rates Snapshots OR a BaseFxRateProvider");
        }

        if (b.length() > 0) {
            throw new IllegalArgumentException(b.toString());
        }
    }
679821
private function _checkEmptyStatement() {
		// If the next valid token is ; then the statement is empty.
		if ($this->_isActive('checkEmptyStatement')) {

			if ($this->tokenizer->checkNextValidToken(T_SEMICOLON)) {
				$this->_writeError('checkEmptyStatement', $this->_getMessage('EMPTY_STATEMENT'));
			}
		}
	}
984899
public function check(array $input)
    {
        $missing = [];
        $invalid = [];

        $check = function ($constraint, $key, $value, $input) use (
            &$missing,
            &$invalid
        ) {
            if ($constraint instanceof AbstractConstraint) {
                if (!$constraint->check($value, $input)) {
                    $invalid[$key][] = $constraint;
                }
            } elseif ($constraint instanceof CheckableInterface) {
                $result = $constraint->check($value);

                $missing = Std::concat(
                    $missing,
                    array_map(
                        function ($subKey) use ($key) {
                            return vsprintf('%s.%s', [$key, $subKey]);
                        },
                        $result->getMissing()
                    )
                );

                foreach ($result->getFailed() as $failedField => $constraints) {
                    $fullPath = vsprintf('%s.%s', [$key, $failedField]);

                    if (array_key_exists($fullPath, $invalid)) {
                        $invalid[$fullPath] = array_merge(
                            $invalid[$fullPath],
                            $constraints
                        );
                    } else {
                        $invalid[$fullPath] = $constraints;
                    }
                }
            } else {
                throw new CoreException(
                    vsprintf(
                        'Unexpected constraint type: %s.',
                        [
                            TypeHound::fetch($constraint),
                        ]
                    )
                );
            }
        };

        $inputMap = ArrayMap::of($input);

        $this->annotations->each(
            function ($value, $key) use (
                $check,
                $input,
                $inputMap,
                &$missing
            ) {
                // If a field is required but not present, we should report it.
                if (Maybe::fromMaybe(
                        false,
                        $value->lookup(static::ANNOTATION_REQUIRED)
                    )
                    && $inputMap->member($key) === false
                ) {
                    $missing[] = $key;

                    // There's no point on checking constraints on the field
                    // since it is missing.
                    return;
                } elseif ($inputMap->member($key) === false) {
                    // There's no point on checking constraints on the field
                    // since it is missing.
                    return;
                }

                $fieldValue = Maybe::fromJust($inputMap->lookup($key));

                $this
                    ->getInternalFieldConstraints($key)
                    ->each(
                        function ($constraint) use (
                            $check,
                            $key,
                            $fieldValue,
                            $input
                        ) {
                            $check($constraint, $key, $fieldValue, $input);
                        }
                    );
            }
        );

        if (count($missing) === 0 && count($invalid) === 0) {
            return new SpecResult($missing, $invalid, SpecResult::STATUS_PASS);
        }

        return new SpecResult($missing, $invalid, SpecResult::STATUS_FAIL);
    }
881896
private function validateSingleImplementation(
        $input,
        CaptureAggregatorInterface $captures,
        ErrorAggregatorInterface $errors
    ): void {
        $serialized = (new BlockSerializer())->serialize($this->getRule()->toBlock())->get();
        $blocks     = BlockSerializer::unserializeBlocks($serialized);

        // the method is expected to be implemented by a class that uses this trait
        $context = $this->createContextStorageFromBlocks($blocks);

        BlockInterpreter::execute($input, $serialized, $context, $captures, $errors);
    }