From 1dfe3bb8216e465da19d3e81b8ef1c9d72d18572 Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Wed, 6 Sep 2023 10:29:39 +0530 Subject: [PATCH] enabled save icon when removing the row --- src/components/actions-menu/DeleteRow.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/actions-menu/DeleteRow.js b/src/components/actions-menu/DeleteRow.js index 9b14542c5..eb568c1f9 100644 --- a/src/components/actions-menu/DeleteRow.js +++ b/src/components/actions-menu/DeleteRow.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useContext } from 'react'; import isEqual from 'lodash.isequal'; import { Button, @@ -12,6 +12,7 @@ import { import { } from '@material-ui/icons'; import { getRowElement, getOffset } from '../../core/datatable'; +import { MarkdownContext } from 'markdown-translatable'; function DeleteRowMenu({ rowData, @@ -22,6 +23,8 @@ function DeleteRowMenu({ button, generateRowId, }) { + const { actions } = useContext(MarkdownContext); + const [open, setOpen] = useState(false); const handleOpen = () => setOpen(true); @@ -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;