Skip to content

Commit

Permalink
fix widget_Choice default
Browse files Browse the repository at this point in the history
  • Loading branch information
rvion committed Dec 6, 2023
1 parent 44cc2db commit b567a80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controls/Widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ export class Widget_choice <T extends { [key: string]: Widget }> implements
}
} else {
const _items = input.items()
const defaultPick: keyof T & string = (Object.keys(_items)[0] ?? '_error_')
const defaultPick: keyof T & string = (input.default as string ?? Object.keys(_items)[0] ??'error')
this.state = { type: 'choice', id: this.id, active: true, values: _items, pick: defaultPick }
}
makeAutoObservable(this)
Expand Down

0 comments on commit b567a80

Please sign in to comment.