## 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 actions = {
      AVG: args => args.reduce((acc, value) => acc + value, 0) / args.length,
      SUM: args => args.reduce((acc, value) => acc + value, 0),
      PRD: args => args.reduce((acc, value) => acc * value, 1),
      MIN: args =>
        args.reduce((acc, value) => Math.min(acc, value), Number.MAX_VALUE),
      MAX: args =>
        args.reduce((acc, value) => Math.max(acc, value), Number.MIN_VALUE),
    };
    if (!(cFunction in actions)) {
      throw new TypeError("Invalid function in AFSimple_Calculate");
    }
    const event = globalThis.event;
    const values = [];
    for (const cField of cFields) {
      const field = this._document.getField(cField);
      const number = this.AFMakeNumber(field.value);
      if (number !== null) {
        values.push(number);
      }
    }
    if (values.length === 0) {
      event.value = cFunction === "PRD" ? 1 : 0;
      return;
    }
    const res = actions[cFunction](values);
    event.value = Math.round(1e6 * res) / 1e6;
  }
  AFSpecial_Format(psf) {