## Attach (recommended) or Link to PDF file here:
The PDF itself is semi-sensitive. I'm happy to provide via unsecured channels, just can't quite post it publicly.

## Configuration:
- Web browser and its version: Firefox 94.0.1
- Operating system and its version: Mac OS 11.6
- PDF.js version: Tested with 2.11.298 (in above Firefox) and git master (5e2aec7dd)

## What is the expected behavior? (add screenshot)
I should be able to fill AForm-validated fields with valid values:
- I should be able to type "123-45-6789" into an SSN field
- I should be able to type "867-5309" into a phone field

## What went wrong? (add screenshot)
I got validation errors instead, when trying to insert the dashes. If I try to not insert the dashes, it lets me while editing, but throws an error when leaving the field.
<img width="426" alt="Screen Shot 2021-11-24 at 11 33 53 AM" src="https://user-images.githubusercontent.com/479715/143302917-ee2f6161-616f-4138-b0af-5048fbe735f6.png">
<img width="426" alt="Screen Shot 2021-11-24 at 11 37 13 AM" src="https://user-images.githubusercontent.com/479715/143302928-741ea372-c9a1-4107-9373-94000e0622ce.png">
<img width="622" alt="Screen Shot 2021-11-24 at 11 38 29 AM" src="https://user-images.githubusercontent.com/479715/143303092-5cc0c999-9c15-4a5d-82ea-be4316bfe755.png">
<img width="622" alt="Screen Shot 2021-11-24 at 11 38 44 AM" src="https://user-images.githubusercontent.com/479715/143303099-b5da332a-c30b-4c2f-bcf6-8635ad58a6b3.png">

## Additional info

For zip codes, the while-typing validation doesn't limit length - I can type as many numbers as I want, and am only complained at once I exit the field.

I've dug into this and will open a PR shortly with more details, but there are other even stranger quirks around internal deletions/insertions as well.
const date = new Date("Sun Apr 15 2007 03:14:15");
        let value = await myeval(
          `util.scand(0, "D:20070415031415").toString()`
        );
        expect(new Date(value)).toEqual(date);
        value = await myeval(`util.scand(1, "2007.04.15 03:14:15").toString()`);
        expect(new Date(value)).toEqual(date);
        value = await myeval(`util.scand(2, "4/15/07 3:14:15 am").toString()`);
        expect(new Date(value)).toEqual(date);
      });
    });
    describe("printf", function () {
      it("should print some data according to a format", async () => {
        let value = await myeval(
          `util.printf("Integer numbers: %d, %d,...", 1.234, 56.789)`
        );
        expect(value).toEqual("Integer numbers: 1, 56,...");
        value = await myeval(
          `util.printf("Hex numbers: %x, %x,...", 1234, 56789)`
        );
        expect(value).toEqual("Hex numbers: 4D2, DDD5,...");
        value = await myeval(
          `util.printf("Hex numbers with 0x: %#x, %#x,...", 1234, 56789)`
        );
        expect(value).toEqual("Hex numbers with 0x: 0x4D2, 0xDDD5,...");
        value = await myeval(
          `util.printf("Decimal number: %,0+.3f", 1234567.89123)`
        );
        expect(value).toEqual("Decimal number: +1,234,567.891");
        value = await myeval(