Skip to content

Commit d529f60

Browse files
committed
fix: change UUIInput type to getter/setter to support input-password
1 parent c9bf476 commit d529f60

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/uui-input-password/lib/uui-input-password.element.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export class UUIInputPasswordElement extends UUIInputElement {
3232

3333
// this overrides the inherited type property, and moves the input's type handling to the passwordType state.
3434
@property()
35-
// @ts-ignore
3635
get type() {
3736
return this.passwordType;
3837
}

packages/uui-input/lib/uui-input.element.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { LitElement, html, css } from 'lit';
1+
import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
22
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
3+
import { css, html, LitElement } from 'lit';
34
import { property, query } from 'lit/decorators.js';
4-
import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
5+
56
import { UUIInputEvent } from './UUIInputEvent';
67

78
export type InputType =
@@ -211,11 +212,18 @@ export class UUIInputElement extends FormControlMixin(LitElement) {
211212
* @default text
212213
*/
213214
@property({ type: String })
214-
type: InputType = 'text';
215+
get type(): InputType {
216+
return this._type;
217+
}
218+
set type(value: InputType) {
219+
this._type = value;
220+
}
215221

216222
@query('#input')
217223
_input!: HTMLInputElement;
218224

225+
private _type: InputType = 'text';
226+
219227
constructor() {
220228
super();
221229

0 commit comments

Comments
 (0)