Skip to content

Commit

Permalink
Accessibility improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nogalpaulina committed Mar 3, 2020
1 parent 9951a0c commit 49b1f2c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# myuw-search versions

## 1.5.0

* Added role='search' to the search form
* Added aria-live="assertive" to announce searched activity
* Added mobile style for search input

## 1.3.1

* Added more components to local demo to test mobile search positioning
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Include the component as follows:
<script nomodule src="https://cdn.my.wisc.edu/@myuw-web-components/myuw-search@latest/myuw-search.min.js"></script>

<myuw-search
slot="myuw-search"
input-label="Search MyUW"
button-label="Submit search"
icon="search"
Expand Down
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,10 @@

<div class="demo__container">
<div class="test-content">
<h1 id="searchLabel">Try using the search bar!</h1>
<p id="searchValue"></p>
<div role="status">
<h1 id="searchLabel">Try using the search bar!</h1>
<p id="searchValue"></p>
</div>
<form name="searchDemo" onsubmit="event.preventDefault();updateSearchBar();">
<div class="form-control">
<label for="searchPlaceholder">Search box placeholder:</label>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@myuw-web-components/myuw-search",
"version": "1.4.0",
"version": "1.5.0",
"description": "A material search field made for use with MyUW web components",
"module": "dist/myuw-search.min.mjs",
"browser": "dist/myuw-search.min.js",
Expand Down
11 changes: 6 additions & 5 deletions src/myuw-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
border-color: rgba(0,0,0,0.15);
color: #333;
background: #fff;
width: 56px;
width: 59px;
height: 40px;
font-size: 1.8rem;
margin: 0;
Expand Down Expand Up @@ -93,7 +93,7 @@
max-width: 0;
margin: 0;
padding: 0;
height: 56px;
height: 59px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
opacity: 0;
Expand Down Expand Up @@ -141,7 +141,8 @@
right: var(--search-mobile-origin);
margin-left: 0;
margin-right: 0;
width: auto;
width: 98.6%;
z-index: 999;
border: var(--myuw-search-border, 1px solid rgba(0,0,0,0.5));
border-radius: 5px;
}
Expand All @@ -168,12 +169,12 @@
}
}
</style>
<form id='form' class='myuw-search-container' onsubmit='$event.preventDefault(); submitSearch($event)'>
<form id='form' role='search' class='myuw-search-container' onsubmit='$event.preventDefault(); submitSearch($event)'>
<button id='toggle' aria-label='' type='button'>
<i id='iconToggle' class='material-icons'></i>
</button>
<input id='input' name='myuw-search-input' aria-label='' type='text' placeholder=''/>
<button id='submit' aria-label='' type='submit'>
<button id='submit' aria-label='' type='submit' aria-live="assertive">
<i id='icon' class='material-icons'></i>
</button>
</form>

0 comments on commit 49b1f2c

Please sign in to comment.