Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/amis/src/renderers/Form/InputText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -503,15 +503,25 @@ export default class TextControl extends React.PureComponent<
}
}

handleChange(value: any) {
async handleChange(value: any) {
const {
onChange,
multiple,
options,
selectedOptions,
creatable,
valueField
valueField,
dispatchEvent
} = this.props;

const rendererEvent = await dispatchEvent(
'change',
resolveEventData(this.props, {value})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里派发的value有问题,应该是处理之后的value,也即onChange抛出的value

);
if (rendererEvent?.prevented) {
return;
}

// Downshift传入的selectedItem是valueField字段,需要取回选项
const toggledOption = options.find(
item => item[valueField || 'value'] === value
Expand Down