Sha256: 8d306d1a83282425625016e6e8d6d6e168e5d3014d065b584d7ddf0568ee999d
Contents?: true
Size: 928 Bytes
Versions: 20
Compression:
Stored size: 928 Bytes
Contents
import Combobox from "models/combobox/base" Combobox.Validity = Base => class extends Base { _markValid() { if (this._valueIsInvalid) return if (this.hasInvalidClass) { this.comboboxTarget.classList.remove(this.invalidClass) } this.comboboxTarget.removeAttribute("aria-invalid") this.comboboxTarget.removeAttribute("aria-errormessage") } _markInvalid() { if (this._valueIsValid) return if (this.hasInvalidClass) { this.comboboxTarget.classList.add(this.invalidClass) } this.comboboxTarget.setAttribute("aria-invalid", true) this.comboboxTarget.setAttribute("aria-errormessage", `Please select a valid option for ${this.comboboxTarget.name}`) } get _valueIsValid() { return !this._valueIsInvalid } get _valueIsInvalid() { const isRequiredAndEmpty = this.comboboxTarget.required && !this.hiddenFieldTarget.value return isRequiredAndEmpty } }
Version data entries
20 entries across 20 versions & 1 rubygems