gpt4 book ai didi

reactjs - Ant Design Popconfirm 确认 [ENTER]?

转载 作者:行者123 更新时间:2023-12-05 08:13:21 27 4
gpt4 key购买 nike

如何让 Popconfirm 对 [ENTER] 键执行确认操作?

And Design Popconfirm widget

render() 
{
const { deleteTask, props } = this.props


const onConfirm = (e) =>
{
deleteTask(
{
id: props._id,
})
}

return (
<Popconfirm placement="topRight" title="Delete row?" onConfirm={onConfirm} okText="Yes" cancelText="No">
<Button type="default">
Delete
</Button>
</Popconfirm>
)
}
}

最佳答案

如果您要使用输入关键字执行任何操作,您需要将整个输入字段保留在表单中并提交表单。

handleSubmit = ()=>{
// submit logic here
}

<form onSubmit={(e) => { e.preventDefault(); this.handleSubmit() }} >

// input fields here
<button type="submit" />
</form>

关于reactjs - Ant Design Popconfirm 确认 [ENTER]?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56024669/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com