Skip to content

Commit c061bfd

Browse files
committed
* pick: support for setting value on trigger syncValue event to pick.
1 parent 4591efc commit c061bfd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/pick/src/components/pick-trigger.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ export class PickTrigger<S extends PickState = PickState, P extends PickTriggerP
8686

8787
componentDidMount(): void {
8888
const {id} = this.props;
89-
$(`#${id}`).on(`change.zui.pick.${id} syncValue.zui.pick.${id}`, (event: Event, from: symbol) => {
89+
$(`#${id}`).on(`change.zui.pick.${id} syncValue.zui.pick.${id}`, (event: Event, from?: symbol | {setValue?: string}) => {
9090
if (typeof from === 'symbol') {
9191
return;
9292
}
93-
const value = (event.target as HTMLInputElement).value;
93+
const value = ($.isPlainObject(from) && typeof from.setValue === 'string') ? from.setValue : (event.target as HTMLInputElement).value;
9494
this._skipTriggerChange = value;
9595
this.props.changeState({value} as Partial<S>);
9696
});

0 commit comments

Comments
 (0)