Skip to content

Commit

Permalink
Merge branch 'release/5.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyTim committed Aug 10, 2024
2 parents be51e37 + 310be5a commit c40e443
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ An easy to use, themeable component for randomising choices and prizes.
### ESM

```javascript
import {Wheel} from 'https://cdn.jsdelivr.net/npm/[email protected].0/dist/spin-wheel-esm.js';
import {Wheel} from 'https://cdn.jsdelivr.net/npm/[email protected].1/dist/spin-wheel-esm.js';
```

### IIFE

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].0/dist/spin-wheel-iife.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/spin-wheel-iife.js"></script>
```

### Local
Expand Down
4 changes: 2 additions & 2 deletions dist/spin-wheel-esm.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/spin-wheel-iife.js

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions examples/playground/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,13 @@ body {

.frame-center {
position: relative;
overflow: hidden;
height: 100%;
width: 100%;
display: grid;
}

.wheel-wrapper {
/* Hide UI during page load */
visibility: hidden;

overflow: hidden;
height: 100%;
width: 100%;
overflow: hidden; /* Prevent grid blowout */
}

.frame-right {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spin-wheel",
"version": "5.0.0",
"version": "5.0.1",
"author": "CrazyTim",
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions src/wheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ export class Wheel {
add(container) {
this._canvasContainer = container;
this.canvas = document.createElement('canvas');

// Prevent infinte resize loop.
// The canvas element has a default display of 'inline'.
// This forms whitespace inside the container, making it slightly larger than it should be,
// which creates a positive feedback loop when the wheel trys to resize itself.
this.canvas.style.display = 'block';

this._context = this.canvas.getContext('2d');
this._canvasContainer.append(this.canvas);
events.register(this);
Expand Down
6 changes: 3 additions & 3 deletions tests/__snapshots__/item.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Item {
aria-label="An image of a spinning prize wheel."
height="500"
role="img"
style="width: 500px; height: 500px;"
style="display: block; width: 500px; height: 500px;"
width="500"
/>
</div>,
Expand All @@ -34,7 +34,7 @@ Item {
aria-label="An image of a spinning prize wheel."
height="500"
role="img"
style="width: 500px; height: 500px;"
style="display: block; width: 500px; height: 500px;"
width="500"
/>,
"_clipIndex": 1,
Expand Down Expand Up @@ -260,7 +260,7 @@ Item {
aria-label="An image of a spinning prize wheel."
height="500"
role="img"
style="width: 500px; height: 500px;"
style="display: block; width: 500px; height: 500px;"
width="500"
/>,
},
Expand Down
6 changes: 3 additions & 3 deletions tests/__snapshots__/wheel.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Wheel {
aria-label="An image of a spinning prize wheel."
height="500"
role="img"
style="width: 500px; height: 500px;"
style="display: block; width: 500px; height: 500px;"
width="500"
/>
</div>,
Expand All @@ -23,7 +23,7 @@ Wheel {
aria-label="An image of a spinning prize wheel."
height="500"
role="img"
style="width: 500px; height: 500px;"
style="display: block; width: 500px; height: 500px;"
width="500"
/>,
"_clipIndex": 1,
Expand Down Expand Up @@ -249,7 +249,7 @@ Wheel {
aria-label="An image of a spinning prize wheel."
height="500"
role="img"
style="width: 500px; height: 500px;"
style="display: block; width: 500px; height: 500px;"
width="500"
/>,
}
Expand Down

0 comments on commit c40e443

Please sign in to comment.