# Signature Pad does not follow cursor

**URL:** <https://forum.ionicframework.com/t/signature-pad-does-not-follow-cursor/121484>\
**Category:** ionic-v3\
**Created:** [February 14, 2018, 2:55pm UTC](https://forum.ionicframework.com/t/signature-pad-does-not-follow-cursor/121484 "2018-02-14T14:55:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![setu1421](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/setu1421/32/117123_2.png) [@setu1421](https://forum.ionicframework.com/u/setu1421)\
**Post date:** [February 14, 2018, 2:55pm UTC](https://forum.ionicframework.com/t/signature-pad-does-not-follow-cursor/121484/1 "2018-02-14T14:55:09Z")

</div>

I am using [angular2-signaturepad](https://www.npmjs.com/package/angular2-signaturepad) library to work with signature in my angular project. Here is my code:

**signature.module.ts**

```
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SignaturePage } from './signature';
import { SignaturePadModule } from 'angular2-signaturepad';

@NgModule({
  declarations: [
    AssinarPage,
  ],
  imports: [
    IonicPageModule.forChild(AssinarPage),
    SignaturePadModule
  ],
})
export class SignaturePageModule {}

```

**signature.ts**

```
export class SignaturePage {
  @ViewChild(SignaturePad) private signaturePad : SignaturePad;
   signaturePadOptions = {
      minWidth: 0.4,
      maxWidth: 1.5,
      dotSize: 1.5,
      penColor: "DarkBlue",
      /* INVERSE BECAUSE IT IS SHOW ONLY IN LANDSCAPE */
      canvasWidth: platform.height(),
      canvasHeight: platform.width() + 30
    }

    drawComplete () {
    if (this.signaturePad.isEmpty()) {
      return this.alertService.showError('Sign first.');
    }

    this.signatureImage = this.signaturePad.toDataURL();
  }

  drawClear () {
    this.signaturePad.clear();
  }

```

**signature.html**

```
<signature-pad [options]="signaturePadOptions" id="signatureCanvas" drag-content="false" ></signature-pad>

```

I saw the live demo of this library in this [link](http://lathonez.com/angular2-signaturepad-demo/) and it is working perfectly here. But in my project, **signature is not following the cursor**.

Is there any configuration i need to change, so the signature follows the cursor in the signature pad?

---

<div class="post-metadata">

**Author:** ![setu1421](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/setu1421/32/117123_2.png) [@setu1421](https://forum.ionicframework.com/u/setu1421)\
**Post date:** [February 15, 2018, 7:11am UTC](https://forum.ionicframework.com/t/signature-pad-does-not-follow-cursor/121484/2 "2018-02-15T07:11:40Z")

</div>

I had to resize the canvas and after that, signature followed the cursor in the signature pad.

```
  canvasResize() {
    let canvas = document.querySelector('canvas');
    this.signaturePad.set('minWidth', 1);
    this.signaturePad.set('canvasWidth', canvas.offsetWidth);
    this.signaturePad.set('canvasHeight', canvas.offsetHeight);
  }
```

---

<div class="post-metadata">

**Author:** ![walysonfelipe](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@walysonfelipe](https://forum.ionicframework.com/u/walysonfelipe)\
**Post date:** [February 17, 2021, 3:20pm UTC](https://forum.ionicframework.com/t/signature-pad-does-not-follow-cursor/121484/3 "2021-02-17T15:20:47Z")

</div>

Thank you very much, it helped me a lot, I was 3 weeks looking for a solution.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 8:52pm UTC](https://forum.ionicframework.com/t/signature-pad-does-not-follow-cursor/121484/4 "2021-07-19T20:52:08Z")

</div>

Closed on July 19, 2021, 8:52pm UTC


