Aspect not working correctly with images + manual fix
See original GitHub issueDescribe the bug
When using b-aspect with images that don’t match the aspect ratio, the images height will become larger and won’t match the desired aspect
Steps to reproduce the bug
- Create an aspect ratio element with an aspect (e.g. 1.8)
- Put an img inside the b-aspect. Make sure the image doesn’t match the aspect ratio, to see the effect it has.
- Make sure the
img
haswidth: 100%
andheight: 100%
to match the container size - See the size (which won’t match the desired aspect ratio)
Expected behavior
The div containing the image (and hence the img as well) to match the aspect ratio
Versions
Libraries:
- BootstrapVue: 2.12.0
- Bootstrap: 4.4.1
- Vue: 2.6.11
Environment:
- Device: Windows
- OS: Windows 10
- Browser: Chrome
- Version: 81
Demo link
https://codesandbox.io/s/bootstrap-vue-sandbox-8zgrw
In the demo there are 2 images blocks: (1) With the aspect. This one doesn’t work.
(2) A manual aspect box which I found how to do online; it’s the workaround I’m currently using an I’m working, although I would prefer to use b-aspect
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
The picture looks too big, stretched, does not fit the screen, or ...
Setting the TV - Manual Modes (back to top). Some signals received by your television may not be displayed correctly with the automatic...
Read more >LG TV Wrong Picture Size or Aspect Ratio | LG USA Support
The majority of Aspect Ratio issues can be resolved by correctly setting options in the Aspect Ratio Menu. Before getting started, verify ...
Read more >Working with Images — Krita Manual 5.0.0 documentation
Detailed steps on how images work in Krita. ... It is not fully correct, as most monitors these days have 125 PPI or...
Read more >How to resize Image with SwiftUI? - ios - Stack Overflow
In SwiftUI, use the .resizable() method to resize an image. By using .aspectRatio() and specifying a ContentMode , you can either "Fit" or ......
Read more >Fixing Resolution of HDMI Output on PC - Driver Support
If you're facing issues with your HDMI output on your PC, you'll need to adjust the resolution or make changes to the settings...
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 FreeTop 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
Top GitHub Comments
We might be able to add a new prop to b-aspect to force the constraint (and apply different CSS classes)
@tmorehouse can you give a tip on how to make b-aspect force the constraint? What CSS should be applied?