mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
fix: slash command does not work (#207)
This commit is contained in:
10
src/hooks/useColumns.tsx
vendored
10
src/hooks/useColumns.tsx
vendored
@@ -53,25 +53,25 @@ interface EditRowProps {
|
||||
}
|
||||
export const EditRow: FC<EditRowProps> = ({ rowKey, row, actions }) => {
|
||||
const [isEdit, setEdit] = useState(false);
|
||||
const [val, setVal] = useState(row[rowKey]);
|
||||
const [val, setVal] = useState(row[rowKey] || '');
|
||||
const handleEdit = () => {
|
||||
setEdit(true);
|
||||
};
|
||||
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setVal(e.target.value)
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
setEdit(false);
|
||||
row[rowKey] = val;
|
||||
row[rowKey] = val?.trim();
|
||||
actions?.setRecord(row, 'rowedit')
|
||||
};
|
||||
|
||||
return isEdit
|
||||
? (
|
||||
<Input.TextArea
|
||||
<Input
|
||||
value={val}
|
||||
rows={1}
|
||||
autoFocus
|
||||
onChange={handleChange}
|
||||
{...DISABLE_AUTO_COMPLETE}
|
||||
onPressEnter={handleSave}
|
||||
|
||||
Reference in New Issue
Block a user