Comments (4)
@obenland what are the steps to reproduce this - I can't seem to trigger it myself.
from wp-core-media-widgets.
To reproduce:
- Set an image and select thumbnail size.
- Save the widget/customizer preview.
- Reload.
- Expand widget toggle.
from wp-core-media-widgets.
Should the image size in the preview be a medium, like the default widget image size, rather than full?
Yes, if the medium
size is available, it should be shown instead of full
. This is currently being done in the media control actually, but I seem to have missed it in the template for the image control. See https://github.com/WordPress/wordpress-develop/blob/5fcfb9b247474e98a5deaa6f04781f3e99583094/src/wp-includes/customize/class-wp-customize-media-control.php#L159-L160
from wp-core-media-widgets.
When previewing an attachment image in the widget preview and the selected size is not the full size, there is a flash of the selected image before the full attachment object has loaded and the image is replaced with its full size. ¶ Should we wait showing a preview of the image until the attachment object has loaded?
The reason this is happening is that we're currently storing the selected image size URL in the model's url
attribute. If the attachment is not loaded yet, then it essentially falls-back to the url
for preview in the control and also in \WP_Widget_Media_Image::render_media()
.
In the control preview template (\WP_Widget_Media_Image::render_control_template_scripts()
), this is the problematic line:
<img class="attachment-thumb" src="{{ data.attachment_id && data.attachment.url ? data.attachment.url : data.url }}" draggable="false" alt="{{ data.alt }}" <# if ( ! data.alt ) { #> aria-describedby="{{ describedById }}" <# } #> />
So perhaps when data.attachment_id && ! data.attachment.url
the template should display a spinner instead? Or perhaps we could continue to show the current cached image url
but with opacity:0.5
to indicate it is still loading?
from wp-core-media-widgets.
Related Issues (20)
- Update "Change [Media]" button to "Replace [Media]"
- Narrow date inputs in the media library
- Warning on WP_Widget_Media::display_media_state() HOT 2
- VideoPress Uploads Not Functioning HOT 19
- Change "Select [Media] HOT 2
- Change "Select [Media]" to "Add [Media]"
- Widgets added/removed using Appearance > Widgets did not reflect in Customizer HOT 5
- Media widget placeholder box looks like a dropzone HOT 6
- .mov Video doesn't play on frontend HOT 13
- Confirm compatibility with Jetpack's Widget Visibility HOT 2
- Implement playlist widget HOT 1
- How can I add extra buttons to the Text Widget editor. HOT 1
- Add a background behind image widget images if they aren't full width HOT 2
- Default to "custom URL" in the image widget HOT 2
- TypeError: control.syncContainer is undefined HOT 5
- Columns in gallery widget preview do not match the frontend HOT 2
- Ensure core themes have styling compatibilities for gallery widgets HOT 1
- Clicking empty gallery placeholder opens manage frame instead of select frame HOT 7
- Resizing of local video in accordion HOT 2
- Option for post/page/external links? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-core-media-widgets.