you need to modify the code in order to display the delete confirmation option
https://github.com/traccar/traccar-web/blob/2eda381152f52eb9b58ac9737d9b8a4f8bb1cf3f/src/common/components/RemoveDialog.jsx#L12
I found this solution using React's Portal component
https://mui.com/base-ui/react-portal/
import React from 'react';
import Button from '@mui/material/Button';
import { Snackbar } from '@mui/material';
import makeStyles from '@mui/styles/makeStyles';
import { useTranslation } from './LocalizationProvider';
import { useCatch } from '../../reactHelper';
import { snackBarDurationLongMs } from '../util/duration';
import { Portal } from '@mui/base/Portal';
const useStyles = makeStyles((theme) => ({
root: {
[theme.breakpoints.down('md')]: {
bottom: `calc(${theme.dimensions.bottomBarHeight}px + ${theme.spacing(1)})`,
},
},
button: {
height: 'auto',
marginTop: 0,
marginBottom: 0,
},
}));
const RemoveDialog = ({
open, endpoint, itemId, onResult,
}) => {
const classes = useStyles();
const t = useTranslation();
const handleRemove = useCatch(async () => {
const response = await fetch(`/api/${endpoint}/${itemId}`, { method: 'DELETE' });
if (response.ok) {
onResult(true);
} else {
throw Error(await response.text());
}
});
return (
<Portal>
<Snackbar
className={classes.root}
open={open}
autoHideDuration={snackBarDurationLongMs}
onClose={() => onResult(false)}
message={t('sharedRemoveConfirm')}
action={(
<Button size="small" className={classes.button} color="error" onClick={handleRemove}>
{t('sharedRemove')}
</Button>
)}
/>
</Portal>
);
};
export default RemoveDialog;
This should fix the issue:
https://github.com/traccar/traccar-web/commit/363d8c31ebaa4487b69ce38cb42098ea147ae489
Yes, the problem is solved. Thank you for your efforts.
On mobile, the region cannot be removed from the menu on the geofences page. Is there a possible temporary solution?
remove button does not work.