emgoto / emgoto-comments

This hosts the comments for my blog, emgoto.com.
https://emgoto.com
0 stars 0 forks source link

react-search-bar/ #11

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

How to build a search bar in React · Emma Goto

A search bar is a great way to make content on your website discoverable. In this tutorial, we’ll be building an accessible search bar…

https://www.emgoto.com/react-search-bar/?utterances=11bcce6cb1aa569365128750EY1D%2BWw2Qx9fq8BUI%2BYN1DdQHQPLKD7hRM9qbJo8xacGAi4FwFDQ0atPUcZtzS%2Fy%2BUMJ1%2FblvhRVph%2Fll%2Bt0IRg5sZAcP1x7ufeBWTeAndI1EiE6uLhb1XzJJ5A%3D

singhArmani commented 2 years ago

Nice article. Thanks for sharing this. We can also enhance the search form by adding role="search". This will cause screen readers to announce that it's a search form. And may be having type="search" onto input element can help browser styles it a little different, and add a x icon.

trollepierre commented 2 years ago

toHaveNoViolations is not easily working. I proceed exactly like you, and I got an error like: TypeError: (0 , _jestAxe.toHaveNoViolations) is not a function

I need to set jest-axe in jest config. You should have precised it in the article.

trollepierre commented 2 years ago

Oops my bad, I didn't see the expect.extend(toHaveNoViolations)

thanks for the article