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

input elements have tabIndex of -1 not 0 by default #1714

Closed
it-harrison opened this issue Jan 31, 2025 · 1 comment · Fixed by #1719
Closed

input elements have tabIndex of -1 not 0 by default #1714

it-harrison opened this issue Jan 31, 2025 · 1 comment · Fixed by #1719
Assignees
Labels
bug Something isn't working

Comments

@it-harrison
Copy link

Describe the bug
The tabIndex property of an input element is -1 by default instead of 0.

To Reproduce
The following minimal test fails:

const screen = render(
   <div>
      <label htmlFor="name">Name</label>
      <input id="name" type="text" />
   </div>,
 );
 const input = screen.getByLabelText('Name');
 expect(input.tabIndex).to.eq(0);

Expected behavior
I expect the test to pass

Device:

  • OS: Mac OS 15.1.1

Additional context
happy-dom: 16.6.0
node: 22.11.0
mocha: 10.7.3
chai: 4.3.4

@it-harrison it-harrison added the bug Something isn't working label Jan 31, 2025
@capricorn86 capricorn86 self-assigned this Feb 8, 2025
capricorn86 added a commit that referenced this issue Feb 8, 2025
…chorElement, HTMLAreaElement, HTMLButtonElement, HTMLIFrameElement, HTMLInputElement, HTMLMediaElement, HTMLObjectElement, HTMLSelectElement and HTMLTextAreaElement
capricorn86 added a commit that referenced this issue Feb 8, 2025
…chorElement, HTMLAreaElement, HTMLButtonElement, HTMLIFrameElement, HTMLInputElement, HTMLMediaElement, HTMLObjectElement, HTMLSelectElement and HTMLTextAreaElement (#1719)
@capricorn86
Copy link
Owner

Thank you for reporting @it-harrison! 🙂

A fix for this was released in v17.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment