-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Image: Reflect media deletion in the editor (#35973)
* initial commit. listening out for changes to the attachments collection and passing to onRemove prop. * Removing console.log * Reverting component changes * Adding a store to media utils * Rolling back historical experimental commits. Now relying on the `onClose` event of the media upload, and the media object to test if the media has been "destroyed." * Testing setting a temporary media object so we can keep track of uploaded media * Winding this back to check if an image exists when the editor loads. This removes the `isSelected` check, but also removes a bunch of code as well. We could run the same check on `isSelected`... TBC * Removed the onerror listener and relying on the error handler already added to the Image props * Fixed grammatical mistake. * Check if the media has been destroyed when the image is selected * Only delete image source URL and ID when detecting a destroyed image. That way the caption, title and alt values persist in case the user deletes, then replaces.
- Loading branch information
Showing
4 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters