Skip to content

Commit

Permalink
feat: fixing currentType bug, modifying error state styles
Browse files Browse the repository at this point in the history
  • Loading branch information
davidken91 committed May 22, 2023
1 parent 98e706d commit 9951bb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/ui-library/src/components/text-input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export class BlrTextInput extends LitElement {

@state() protected currentType: InputTypes = this.type;

connectedCallback() {
super.connectedCallback();
this.currentType = this.type;
}

toggleInputType() {
this.currentType = this.currentType === 'password' ? 'text' : 'password';
}
Expand Down Expand Up @@ -99,9 +104,9 @@ export class BlrTextInput extends LitElement {
? html`<blr-icon
class="blr-input-icon ${inputClasses}"
@click=${this.toggleInputType}
icon="${this.hasError ? 'blrInfoSm' : getPasswordIcon()}"
icon="${getPasswordIcon()}"
size="sm"
name="${this.hasError ? 'blrInfoSm' : getPasswordIcon()}"
name="${getPasswordIcon()}"
aria-hidden
></blr-icon>`
: html``}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ export const form = css`
}
&.error-input {
background-color: ${Forms.SurfaceFill.Error.Rest};
border-width: ${Forms.Input.Error.Rest.width};
border-style: ${Forms.Input.Error.Rest.style};
border-color: ${Forms.Input.Error.Rest.color};
outline-color: ${Forms.Input.Error.Rest.color};
color: ${Forms.UserInput.Error.Rest};
&::placeholder {
color: ${Forms.Placeholder.Error.Rest};
Expand Down

0 comments on commit 9951bb4

Please sign in to comment.