Skip to content

Placeholder links currently (incorrectly) require role="button" and tabIndex #62

@kloots

Description

@kloots

HTML5 doesn't require the href attribute on links, but our tests fail since the code checks if the tabIndex is set using strict inequality:

props.tabIndex !== null

New tests that need to be added to check for this:

describe('placeholder links without href', () => {
  it('does not warn', () => {
    doNotExpectWarning(assertions.tags.a.HASH_HREF_NEEDS_BUTTON.msg, () => {
      <a class="foo" />;
    });
  });
});

describe('placeholder links without tabindex', () => {
  it('does not warn', () => {
    doNotExpectWarning(assertions.tags.a.TABINDEX_NEEDS_BUTTON.msg, () => {
      <a class="foo" />;
    });
  });
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions