Cannot get this to work inside of my component...
See original GitHub issueSoooo, I can get this to work with a basic image with basic CSS, like so:
progressive-img {
width: 100%;
height: auto;
}
…but I cannot seem to get it to work with more specific CSS inside of a custom vue component. the image simply does not show up at all.
Can you see anything in this CSS that might be causing an issue with the plugin?
This is the CSS of the parent component:
.component {
width: 100%;
height: calc(100vh - 48px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
background: url(../../assets/images/logos/arrow-favicon-blue-10-percent.svg) no-repeat center 25vh, #091830;
}
and here is the CSS of the progressive-image, which is a child of the parent .component:
progressive-img {
width: 100vw;
height: calc(100vh - 48px);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
object-fit: cover;
z-index: 1;
}
@media screen and (orientation: landscape) {
progressive-img {
width: 70vw;
height: 100vh;
}
}
Please let me know if you see anything, or if you need any more information to understand better. I looks like the image tries to load by flickering for a split second, but then it’s gone, if that helps at all.
…I think it’s almost there! XD
R
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unable to access React instance (this) inside event handler
this.changeContent needs to be bound to the component instance via this.changeContent.bind(this) before being passed as the onChange prop, otherwise the ...
Read more >Bug: too hard to fix "Cannot update a component from inside ...
It's setState on other components that are bad. You can't detect those statically.
Read more >Rules of Hooks - React
Don't call Hooks inside loops, conditions, or nested functions. Instead, always use Hooks at the top level of your React function, before any...
Read more >REACT – Simple Intro Component Not Rendering?
render(<App />,mainNode);. But mainIntro isn't loading for some reason. Let's take a closer look at what's happening. Naming your components.
Read more >Understanding common frustrations with React Hooks
Editor's note · “React Hook cannot be called inside a callback” · “React Hooks must be called in a React function component or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

you might want to use
progressive-backgroundfor this, theprogressive-imgit maintains a responsive aspect ratio, that’s why doesn’t fit completely and also remember that when you add the object-fit property to your.progressive-imageclass, you are not actually targeting an img tag, but a bunch of divs and an image tag somewhere inside that structure: make sense that doesn’t work 😃@rchrdnsh thanks a lot 😃