React Mui TableCell 离开事件
React Mui TableCell leave event
我有一个 material UI table 并且在行内,我有 editable 个字段。
有很多事件像
onInputCapture、onFocusCapture 等。
但我找不到应该在我离开牢房或
什么时候我完成编辑。
我不想使用 onMouseLeaving 因为客户可能会使用 Tab 按钮离开
细胞。
是否有这样的事件:我完成了编辑?
谢谢。
<TableCell align="right" contentEditable={true}
onInputCapture={ (e: React.ChangeEvent<HTMLTableCellElement>) =>
{
//some logic
}} >{data.ammount}</TableCell>
mui 不直接支持 ContentEditable,因此对于任何 div 都是一样的,即 onInput
这是一个示例stackblitz
编辑:
您可以尝试添加此库 react-contenteditable
我更新了 stackblitz,它适用于模糊
我有一个 material UI table 并且在行内,我有 editable 个字段。
有很多事件像 onInputCapture、onFocusCapture 等。
但我找不到应该在我离开牢房或 什么时候我完成编辑。 我不想使用 onMouseLeaving 因为客户可能会使用 Tab 按钮离开 细胞。 是否有这样的事件:我完成了编辑?
谢谢。
<TableCell align="right" contentEditable={true}
onInputCapture={ (e: React.ChangeEvent<HTMLTableCellElement>) =>
{
//some logic
}} >{data.ammount}</TableCell>
mui 不直接支持 ContentEditable,因此对于任何 div 都是一样的,即 onInput
这是一个示例stackblitz
编辑:
您可以尝试添加此库 react-contenteditable
我更新了 stackblitz,它适用于模糊