Skip to content

Commit

Permalink
Fix bug: Canvas width is ignored (#5)
Browse files Browse the repository at this point in the history
Fix bug #4
  • Loading branch information
gibbok authored Aug 4, 2020
1 parent e0fe86d commit 93011ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Live demo here: <https://gibbok.github.io/react-color-picker-palette/>

### Installation

In your terminal navigate to you `package.json` file and run:
This package is [available on npm](https://www.npmjs.com/package/react-color-picker-palette), to install it, use your terminal and navigate to you `package.json` file and run:

`npm i react-color-picker-palette`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-color-picker-palette",
"version": "2.0.3",
"version": "2.0.4",
"description": "ColorPickerPalette is a React reusable color picker palette written in TypeScript.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/ColorPickerPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export const ColorPickerPalette = ({
<canvas
data-cy="canvas"
style={{ ...styles.canvas }}
width={styles.canvas.width}
height={styles.canvas.height}
ref={canvasRef}
onClick={(e) => {
selectColor(e);
Expand Down
6 changes: 6 additions & 0 deletions src/__snapshots__/ColorPickerPalette.stories.storyshot
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ exports[`Storyshots ColorPickerPalette custom 1`] = `
>
<canvas
data-cy="canvas"
height={250}
onClick={[Function]}
style={
Object {
Expand All @@ -81,6 +82,7 @@ exports[`Storyshots ColorPickerPalette custom 1`] = `
"width": 400,
}
}
width={400}
/>
<div
style={
Expand Down Expand Up @@ -184,6 +186,7 @@ exports[`Storyshots ColorPickerPalette dark 1`] = `
>
<canvas
data-cy="canvas"
height={150}
onClick={[Function]}
style={
Object {
Expand All @@ -195,6 +198,7 @@ exports[`Storyshots ColorPickerPalette dark 1`] = `
"width": 300,
}
}
width={300}
/>
<div
style={
Expand Down Expand Up @@ -296,6 +300,7 @@ exports[`Storyshots ColorPickerPalette light 1`] = `
>
<canvas
data-cy="canvas"
height={150}
onClick={[Function]}
style={
Object {
Expand All @@ -306,6 +311,7 @@ exports[`Storyshots ColorPickerPalette light 1`] = `
"width": 300,
}
}
width={300}
/>
<div
style={
Expand Down

0 comments on commit 93011ca

Please sign in to comment.