Skip to content

Commit fa99f07

Browse files
committed
Add an option to pass properties to the canvas element
1 parent 6473ff1 commit fa99f07

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/SignaturePad.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class SignaturePad extends PureComponent {
1010
static propTypes = {
1111
width: PropTypes.number,
1212
height: PropTypes.number,
13-
className: PropTypes.string,
1413
options: PropTypes.object,
1514
redrawOnResize: PropTypes.bool.isRequired,
16-
debounceInterval: PropTypes.number.isRequired
15+
debounceInterval: PropTypes.number.isRequired,
16+
canvasProps: PropTypes.object
1717
}
1818

1919
static defaultProps = {
@@ -204,10 +204,12 @@ class SignaturePad extends PureComponent {
204204
}
205205

206206
render() {
207+
const {canvasProps} = this.props;
208+
207209
return (
208210
<canvas
209-
className={this.props.className}
210-
ref={ref => this._canvas = ref} />
211+
ref={ref => this._canvas = ref}
212+
{...canvasProps} />
211213
);
212214
}
213215

0 commit comments

Comments
 (0)