Skip to content

Commit

Permalink
Fixed the tabindex attribute name that is set on the hidden textare…
Browse files Browse the repository at this point in the history
…a used for height calculations (#327)

* Change tab-index to tabindex.

The "tab-index" property does not prevent the hidden element from being keyboard accessible, it should be tabindex. See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex

* Create rotten-radios-travel.md

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
  • Loading branch information
circlingthesun and Andarist authored Jun 2, 2021
1 parent 868aeed commit 6336448
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rotten-radios-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-textarea-autosize": patch
---

Fixed the `tabindex` attribute name that is set on the hidden textarea used for height calculations.
2 changes: 1 addition & 1 deletion src/calculateNodeHeight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function calculateNodeHeight(
): CalculatedNodeHeights {
if (!hiddenTextarea) {
hiddenTextarea = document.createElement('textarea');
hiddenTextarea.setAttribute('tab-index', '-1');
hiddenTextarea.setAttribute('tabindex', '-1');
hiddenTextarea.setAttribute('aria-hidden', 'true');
forceHiddenStyles(hiddenTextarea);
}
Expand Down

0 comments on commit 6336448

Please sign in to comment.