Skip to content

Commit

Permalink
fix(input): listen value changes in native input (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
muratcorlu authored Sep 8, 2022
1 parent 04b0023 commit 116919c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/input/bl-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';
import { customElement, property, query, state } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { live } from 'lit/directives/live.js';
import { event, EventDispatcher } from '../../utilities/event';
import '../icon/bl-icon';

Expand Down Expand Up @@ -41,8 +42,8 @@ export default class BlInput extends LitElement {
/**
* Sets initial value of the input
*/
@property({})
value?: string;
@property()
value = '';

/**
* Makes input a mandatory field
Expand Down Expand Up @@ -189,7 +190,7 @@ export default class BlInput extends LitElement {
<input
type=${this.type}
class=${classMap(classes)}
value=${ifDefined(this.value)}
.value=${live(this.value)}
placeholder="${ifDefined(this.placeholder)}"
minlength="${ifDefined(this.minlength)}"
maxlength="${ifDefined(this.maxlength)}"
Expand Down

0 comments on commit 116919c

Please sign in to comment.