Sha256: bb567b04dd96aa667bd76ad8540ee8354585f32576e267b5e0f28fd35aef0467
Contents?: true
Size: 940 Bytes
Versions: 6
Compression:
Stored size: 940 Bytes
Contents
import Combobox from "hw_combobox/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
6 entries across 6 versions & 1 rubygems