Skip to content

Commit

Permalink
enabled save icon when removing the row
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-C-Johnson committed Sep 6, 2023
1 parent 9f9ebb9 commit 1dfe3bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/actions-menu/DeleteRow.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useState, useContext } from 'react';
import isEqual from 'lodash.isequal';
import {
Button,
Expand All @@ -12,6 +12,7 @@ import {
import {
} from '@material-ui/icons';
import { getRowElement, getOffset } from '../../core/datatable';
import { MarkdownContext } from 'markdown-translatable';

function DeleteRowMenu({
rowData,
Expand All @@ -22,6 +23,8 @@ function DeleteRowMenu({
button,
generateRowId,
}) {
const { actions } = useContext(MarkdownContext);

const [open, setOpen] = useState(false);

const handleOpen = () => setOpen(true);
Expand All @@ -37,6 +40,11 @@ function DeleteRowMenu({
const rowAbove = getRowElement(generateRowId, rowData, position);
rowDelete({ rowIndex });
handleClose();

if (actions && actions.setIsChanged) {
actions.setIsChanged(true);
}

setTimeout(() => {
if (rowAbove) {
const top = getOffset(rowAbove).top;
Expand Down

0 comments on commit 1dfe3bb

Please sign in to comment.