Skip to content

Commit

Permalink
fix(hiddenTextarea): A form field element should have an id or name a…
Browse files Browse the repository at this point in the history
…ttribute (#59)
  • Loading branch information
zhe-he authored Sep 20, 2024
1 parent b0e9f43 commit e231963
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/calculateNodeHeight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ export default function calculateAutoSizeStyle(
hiddenTextarea = document.createElement('textarea');
hiddenTextarea.setAttribute('tab-index', '-1');
hiddenTextarea.setAttribute('aria-hidden', 'true');
// fix: A form field element should have an id or name attribute
// A form field element has neither an id nor a name attribute. This might prevent the browser from correctly autofilling the form.
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
hiddenTextarea.setAttribute('name', 'hiddenTextarea');
document.body.appendChild(hiddenTextarea);
}

Expand Down

0 comments on commit e231963

Please sign in to comment.