You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package implements exactly the same interface as the original *signature_pad* and adds a couple of extra features that make responsive behaviour a little easier to deal with. For a complete overview of the available options and callables see the documentation for [signature pad](https://github.com/szimek/signature_pad).
The HTML canvas object sucks when it comes to responsiveness. The approach taken with this plugin is to use a fixed size canvas when a height and width (in pixels) is explicitly passed in as a component property:
51
-
```
51
+
```javascript
52
52
...
53
53
render() {
54
54
return<SignaturePad width={500} height={500} />;
@@ -57,7 +57,7 @@ render() {
57
57
```
58
58
59
59
If you want the component to be responsive, simply ommit the width and height property:
60
-
```
60
+
```javascript
61
61
...
62
62
render() {
63
63
return<SignaturePad />;
@@ -67,7 +67,7 @@ render() {
67
67
The canvas width and height will now be updated whenever the window is resized (using a debounced handler). Changing the width and height properties of a HTML canvas object will erase its current content.
68
68
69
69
If you'd like to keep what is currently drawn on the canvas you can pass a `redrawOnResize` property to the component and set it to `true` (`redrawOnResize` is `false` by default):
0 commit comments