Attach (recommended) or Link to PDF file [here:] Can't see how to attach a pdf here, but it is simple to create. Add a form object textbox to a pdf and make sure the option for "Multiline" is true.

Steps to reproduce the problem:
1.  Open a document with a Textbox that is set to Multiline.
2. Attempt to hit the Enter key to go to a new line.

What is the expected behavior? The cursor goes to a new line.

What went wrong? It does not go to a new line.

Link to a viewer: It can be reproduced on mozilla.github.io/pdf.js

I corrected the issue by altering the pdf.js file like this
element.addEventListener("keydown", event => { 
[...]
--} else if (event.key === "Enter") {
++ } else if (event.key === "Enter" && !this.data.multiLine) {

Our initial testing is coming through clean, and hopefully something like this code can be committed to the project in the future.

const data = this.data,
      page = this.page,
      viewport = this.viewport;
    const container = document.createElement("section");
    const { width, height } = getRectDims(data.rect);
    const [pageLLx, pageLLy, pageURx, pageURy] = viewport.viewBox;
    const pageWidth = pageURx - pageLLx;
    const pageHeight = pageURy - pageLLy;
    container.setAttribute("data-annotation-id", data.id);
    
    
    const rect = Util.normalizeRect([
      data.rect[0],
      page.view[3] - data.rect[1] + page.view[1],
      data.rect[2],
      page.view[3] - data.rect[3] + page.view[1],
    ]);
    if (!ignoreBorder && data.borderStyle.width > 0) {
      container.style.borderWidth = `${data.borderStyle.width}px`;
      const horizontalRadius = data.borderStyle.horizontalCornerRadius;
      const verticalRadius = data.borderStyle.verticalCornerRadius;
      if (horizontalRadius > 0 || verticalRadius > 0) {
        const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`;
        container.style.borderRadius = radius;
      } else if (this instanceof RadioButtonWidgetAnnotationElement) {
        const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`;
        container.style.borderRadius = radius;
      }