mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 22:54:31 +00:00
Merge pull request #5810 from strapi/media-lib/cm-delete-file
Fix input media delete
This commit is contained in:
commit
94eca0a21e
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
||||
import { get } from 'lodash';
|
||||
@ -32,6 +32,10 @@ const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
|
||||
const displaySlidePagination =
|
||||
attribute.multiple && value.length > 1 ? ` (${fileToDisplay + 1}/${value.length})` : '';
|
||||
|
||||
useEffect(() => {
|
||||
setFileToDisplay(0);
|
||||
}, [modal.isOpen]);
|
||||
|
||||
const handleClickToggleModal = () => {
|
||||
setModal(prev => ({ isDisplayed: true, step: 'list', isOpen: !prev.isOpen, fileToEdit: null }));
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user