-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image height broken #157
Comments
Did you visit CSS Customizer? If you manipulate slider-height-percentage property, you will see that react awesome slider doesn't maintain aspect ratio but instead cuts what is seen.
I had similiar problem, and it seems that not only me. Before I've used scss file, I wanted to fix image ratio using CSS only but when I overrode the image rule that sets width and height to 100%, it broke slider and I assume that it was due to other applied rules that were cleared because of my override. So I see 2 approaches here if you really want to make this work as you want.
|
Hey thanks for the providing suggestions how to fix the problem. Based on your hints I came up with following work-around:
fixSlider.css:
This keeps the images aspect ratio but leaves gray padding within the slider depending on the current images aspect ratio. So still not optimal but it is ok. Perfect would be in my book if AwesomeSlider would fit the width of the parent (what it does already) and also adjust its height based on the current image aspect ratio (fitting image to parent width and then fitting AwesomeSlider height to aspect ratio preserving new image height). |
Good to hear that you somehow resolved this 😄 However I must mention(like in previous thread) that the approach with fixSlider didn't work for me, unless I explicitly put reference to imported css to cssModule property but this caused very odd behaviour. Maybe because of Docusaurus2 starter that I've used... Anyway, are you sure you need that |
Hmm ok no clue what is up with that on your side... Yes you are right the fillParent is old garbage left over after trying various things out. 🗡️ |
Just tried out react-awesome-slider and found out that it sadly breaks my images displaying them vertically too small. It fits my parent div containers width but fails to fill the correct image height (desired behavior: Fit awesome-slider height to keep original image aspect ratio).
I deal with currently like this:
That helps a little bit but is still far from fixing it correctly.
I am aware of the following three issues with similar problems: #146, #101, #147. I expected this functionality to work straight out of the box for an awesome image slider. Anyone aware of a proper fix?
At #147 I stumbled upon following suggestion, fixing the css:
But it makes matters worse for me, it display images with correct aspect ratios but not 1 but 2 at the same time (vertically stacked). So not a fix.
Hope anyone has an idea how to mitigate this issue.
The text was updated successfully, but these errors were encountered: