Accessing file path in Attachment Details modal

I came across what seems to me like a bug when I was testing imports in WordPress. I just tried it in ClassicPress and it’s almost the same.

So, by default, images are in month/day folders, and I had imported the theme unit test data. I wanted to see whether the image would use the date of the post or the date of the image or the current date. (this was actually for a WP forum question about why it wasn’t using date of post)

I went to the Media Library and clicked on an image and only part of the file path is visible. The field is too short to show it all, so I clicked in the field and tried to scroll right using the arrow key, like I do in the Edit Image page.

But in this Attachment Detail modal, the arrow key is taken to mean you want to move to the next image instead of interacting with the field. The only way to get the full path is to double click it to select and copy it somewhere else.

The bug is the treatment of the arrow keys in the modal. Or maybe it’s not being able to see the whole file path.
What do you think?

ClassicPress:
classic-arrow-ijey-n-link

In WP, they have recently moved the file path from the top to the bottom, and changed the label from “URL” to “Copy link”, with some JS to copy the path. I don’t think it solves anything.
WordPress:
arrow-key-in-link-field

4 Likes

I hadn’t tried the arrows for other than navigating the media… that does seem a bit inconvenient, though, to have the arrow “hijacked” (for lack of a better term). For that field, I’ve always just double-clicked it to select the whole URL.

1 Like

When an input is listed as readonly I don’t think you can use the arrows by default anyways. From what I recall you have to use shift + arrow to move along a readonly text field.

That being said, after testing it in CP, looks like shift + arrow acts the same as just using the arrows in that modal. That would likely need to be where the adjustment is made (if any).

2 Likes

Yes, I have the same problem in both Firefox and Chrome. Hadn’t noticed that before.

I’ve just tried it in WP 4.8.12 and shift + arrow does select the text as you’d expect. So this is something that has been introduced between 4.8.12 and 4.9.x.

1 Like

That doesn’t quite make sense that it works in 4.8.12, because I see the same thing in 4.7.16.

And it’s not because it’s readonly, since the arrow keys work just fine on the file path field in the Edit Image page, where it is readonly.

I think it’s because of the modal that hijacks the arrow keys to work with the Next/Prev arrows of the modal.

The best thing for the user would be to display the entire path. It is a Details modal, after all. The details should be visible. I only tried the arrow because I couldn’t see the path (and I have done it on the Edit page).
Perhaps details should be below the image instead of in a skinny thing on the right. (what happens on mobile?)

Yes, this has been an irritation for me too. If I am trying to dig out an image from the uploads folder and find its location within all those year and month folders I have to do the copy and paste trick to see the end of the url.

In my experience…

From what limited testing I have done, shift + arrow works with any version of WP (up to 4.9.13).

In CP 1.1.2, shift + arrow does not work when accessing the image in grid mode but does work when accessing the image in list mode.

That’s all I’ve been able to find out so far. For me anyway.

1 Like

@1stepforward is right the shift + arrow does not work when accessing the image in grid mode, but works in list mode.

Another thing I founded was that the shift + arrow works when using the Attachment Detail modal directing in the post editor. But really, as @anon71687268 said, double-clicking would do the trick, I use that a lot.

1 Like