Attach (recommended) or Link to PDF file here: 

Configuration:
- Web browser and its version: Firefox 112.0.2
- Operating system and its version: MacOS Monterey 12.0.1
- PDF.js version: 3.5.35
- Is a browser extension: no

Steps to reproduce the problem:
1. Open attached pdf
2. Type some text into the field, click outside of the field to unfocus 
3. Remove all text from the field and click outside of the field to unfocus 

What is the expected behavior? (add screenshot)
The field should be empty.
<img width="1106" alt="Screenshot 2023-05-10 at 21 51 06" src="https://github.com/mozilla/pdf.js/assets/47328547/6889d38d-87f8-44b3-8325-684f64eac88b">

What went wrong? (add screenshot)
Field is not being cleared - it's not possible to make the field empty.
I found out that if you add any and I mean just any javascript - e.g. just a simple console print statement this problem occurs. However if I remove all javascript, the text field is cleared properly
<img width="832" alt="Screenshot 2023-05-10 at 21 52 33" src="https://github.com/mozilla/pdf.js/assets/47328547/7940c128-ae7a-4879-8d8f-57b08363def4">
[empty-text-field.pdf](https://github.com/mozilla/pdf.js/files/11445510/empty-text-field.pdf)


Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

return shadow(this, "fallbackFontDict", dict);
  }
}
class ChoiceWidgetAnnotation extends WidgetAnnotation {
  ructor(params) {
    (params);
     { dict, xref } = params;
    this.indices = dict.getArray("I");
    this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0;
     Determine the options. The options array may ist of strings or
     arrays. If the array ists of arrays, then the first element of
     each array is the export value and the second element of each array is
     the display value. If the array ists of strings, then these
     represent both the export and display value. In this case, we convert
     it to an array of arrays as well for convenience in the display layer.
     Note that the specification does not state that the `Opt` field is
     inheritable, but in practice PDF generators do make annotations
     inherit the options from a parent annotation (issue 8094).
    this.data.options = [];
     options = getInheritableProperty({ dict, key: "Opt" });
    if (Array.isArray(options)) {
      for (let i = 0, ii = options.length; i < ii; i++) {
         option = xref.fetchIfRef(options[i]);
         isOptionArray = Array.isArray(option);
        this.data.options[i] = {
          exportValue: this._decodeFormValue(
            isOptionArray ? xref.fetchIfRef(option[0]) : option
          ),
          displayValue: this._decodeFormValue(
            isOptionArray ? xref.fetchIfRef(option[1]) : option