WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 3 months ago

#48026 new defect (bug)

Always show selected image even if it doesn't match search string

Reported by: galbaras Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:
PR Number:

Description

When embedding an image in a post, if there is a pattern in the search box and an image is uploaded that doesn't match it, the new image details are not shown until the search pattern is cleared.

Steps:

  1. Click "Add Media"
  1. Enter search pattern, e.g. "abc"
  1. Switch to "Upload Files" tab and upload a file, e.g. "xyz"
  1. Once the file is uploaded, you see the "Media Library" tab again, but no details are showing in the "Attachment Details" area, although the newly-uploaded file is selected
  1. Clear the search pattern
  1. Selected image details appear

The correct behavior is to always show the details of the selected file, even if it doesn't match the search pattern, at least immediately after it's been uploaded.

Change History (2)

#1 @joemcgill
3 months ago

Hi @galbaras. Thanks for this ticket and steps to reproduce. Unfortunately, I'm not able to reproduce this bug as described. I've tried inserting an image into a post in both the classic editor and in the new block editor (Gutenberg) and in each case I am doing the following:

  1. Open the media library
  2. Enter a search term – notice that the image library is now only showing images that include the search term
  3. Switch to the upload tab and upload a new image that doesn't include the search term
  4. Notice that the grid stays the same, but the attachment details show information from the newly uploaded file.

Either this has been fixed by another change, or I'm misunderstanding how to reproduce this bug. Could you please either confirm that this has been fixed or provide additional details? Thanks!

#2 @galbaras
3 months ago

Hi @joemcgill,

You're getting the same results as I'm getting. To me, this is incorrect user interface.

When I upload a file, it's automatically selected. This is reflected in the details panel, but without clearing the search pattern, is not reflected in the grid.

Basically, by uploading a file, you're giving up on finding a suitable image in the media library and telling WordPress "Let's try something else", but WordPress is still trying to find something that's clearly not there.

I hope this makes things clearer.

Cheers,
Gal

Note: See TracTickets for help on using tickets.