Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hiddenTextarea): A form field element should have an id or name attribute #59

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading