diff --git a/packages/carbon-web-components/src/components/input/input.ts b/packages/carbon-web-components/src/components/input/input.ts index 043f4cbdd03..a7d932272ad 100644 --- a/packages/carbon-web-components/src/components/input/input.ts +++ b/packages/carbon-web-components/src/components/input/input.ts @@ -49,6 +49,12 @@ export default class BXInput extends ValidityMixin(FormMixin(LitElement)) { */ protected _value = ''; + /** + * Set initial value of input + */ + @property({ reflect: true }) + value = ''; + /** * Handles `oninput` event on the ``. * @@ -198,32 +204,6 @@ export default class BXInput extends ValidityMixin(FormMixin(LitElement)) { @property({ attribute: 'validity-message' }) validityMessage = ''; - /** - * The value of the input. - */ - @property({ reflect: true }) - get value() { - // FIXME: Figure out how to deal with TS2611 - // once we have the input we can directly query for the value - if (this._input) { - return this._input.value; - } - // but before then _value will work fine - return this._value; - } - - set value(value) { - const oldValue = this._value; - this._value = value; - // make sure that lit-element updates the right properties - this.requestUpdate('value', oldValue); - // we set the value directly on the input (when available) - // so that programatic manipulation updates the UI correctly - if (this._input) { - this._input.value = value; - } - } - createRenderRoot() { return this.attachShadow({ mode: 'open',