Skip to content

Commit

Permalink
fix type error when options is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN committed Feb 22, 2023
1 parent 1dffd74 commit 7ed5715
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/presets/classic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export class InputControl<T extends 'text' | 'number', N = T extends 'text' ? st
constructor(public type: T, public options?: InputControlOptions<N>) {
super()
this.id = getUID()
this.readonly = options.readonly
this.readonly = options?.readonly

if (typeof options.initial !== 'undefined') this.value = options.initial
if (typeof options?.initial !== 'undefined') this.value = options.initial
}

setValue(value?: N) {
Expand Down

0 comments on commit 7ed5715

Please sign in to comment.