Skip to content

Commit

Permalink
fix(frontend): move error message before tag input
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Apr 19, 2024
1 parent 84db24f commit 4e7dd1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/frontend/components/tag-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import TagInput from "@accessible-components/tag-input";

export const TagInputFieldComponent = class extends HTMLElement {
connectedCallback() {
this.$errorMessage = this.querySelector(".error-message");
this.$hint = this.querySelector(".hint");
this.$replacedLabel = this.querySelector(".label");
this.$replacedInput = this.querySelector(".input");
Expand Down Expand Up @@ -30,6 +31,10 @@ export const TagInputFieldComponent = class extends HTMLElement {
this.insertBefore(this.$hint, this.querySelector(".tag-input"));
}

if (this.$errorMessage) {
this.insertBefore(this.$errorMessage, this.querySelector(".tag-input"));
}

this.querySelector(".tag-input-label").classList.add("label");

this.$replacedLabel.remove();
Expand Down

0 comments on commit 4e7dd1d

Please sign in to comment.