Search results

Accessibility in JavaScript Signature control

06 Jun 2023 / 1 minute to read

Keyboard interaction

The following list of keys can be used to interact with the Signature control.

Properties Functionality
Ctrl + Z Undo the last user action.
Ctrl + Y Redo the last user action.
Ctrl + S To save the signature.
delete Erases all the signature strokes signed by user.
Source
Preview
app.ts
index.html
styles.css
Copied to clipboard
import { Signature } from '@syncfusion/ej2-inputs';

let signature: Signature = new Signature({}, '#signature');
Copied to clipboard
<!DOCTYPE html>
<html lang="en">

<head>
            
    <title>EJ2 Signature</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="TypeScript Signature Component" />
    <meta name="author" content="Syncfusion" />
    <link href="styles.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-inputs/styles/material.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>
<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <h4>Sign here</h4>
        <div id ="signature-control">
            <canvas id="signature"></canvas>
        </div>
    </div>
</body>
</html>
Copied to clipboard
#container {
    visibility: hidden;
}

#loader {
  color: #008cff;
  font-family: 'Helvetica Neue','calibiri';
  font-size: 14px;
  height: 40px;
  left: 45%;
  position: absolute;
  top: 45%;
  width: 30%;
}

#signature {
  border: 1px solid lightgray;
  height: 100%;
  width: 100%;
}

#signature-control {
  height: 300px;
  width: 650px;
}