Skip to content

Commit

Permalink
fix aspect ratio bug
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Oct 19, 2021
1 parent fc78360 commit 72f2cbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/resources/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
- Fixed a bug where the tooltip would show briefly when clicking a disabled `<sl-range>`
- Fixed a bug that caused a console error when `<sl-range>` was used
- Fixed a bug where the `nav` part in `<sl-tab-group>` was on the incorrect element [#563](https://github.com/shoelace-style/shoelace/pull/563)
- Fixed a bug where non-integer aspect ratios were calculated incorrectly in `<sl-responsive-media>`
- Updated to Bootstrap Icons to 1.6.1

## 2.0.0-beta.57
Expand Down
4 changes: 2 additions & 2 deletions src/components/responsive-media/responsive-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default class SlResponsiveMedia extends LitElement {

render() {
const split = this.aspectRatio.split(':');
const x = parseInt(split[0]);
const y = parseInt(split[1]);
const x = parseFloat(split[0]);
const y = parseFloat(split[1]);
const paddingBottom = x && y ? `${(y / x) * 100}%` : '0';

return html`
Expand Down

0 comments on commit 72f2cbe

Please sign in to comment.