Skip to content

Commit 356012a

Browse files
authored
Pd-5329 fix search aria label (#2808)
* PD-5329 fix search aria label * PD-5329 fix aria-decribedby application * PD-5329 fix search styling * PD-5329 fix search a11y * PD-5329 more a11y --------- Co-authored-by: andrej romanov <50377758+auumgn@users.noreply.github.com>
1 parent af15777 commit 356012a

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/app/layout/search/search.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
class="row h-end search-box middle"
1212
(submit)="search(whereToSearchSelected, whatToSearch)"
1313
*ngIf="!hideForm"
14-
aria-describedby="cy-search"
1514
>
16-
<label i18n class="orc-ui-font-small-print text-right mr-4 w-25"
15+
<label
16+
i18n
17+
id="searchLabel"
18+
class="orc-ui-font-small-print text-right mr-4 w-25"
1719
>Search the ORCID registry</label
1820
>
1921
<div id="ariaLabelWhere" hidden>Search on</div>
@@ -23,7 +25,7 @@
2325
name="whatToSearch"
2426
[(ngModel)]="whatToSearch"
2527
type="text"
26-
[attr.aria-label]="labelSearchBy"
28+
aria-labelledby="searchLabel"
2729
id="cy-search"
2830
class="orc-font-body"
2931
/>

src/app/layout/search/search.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
}
5656

5757
.input-box-new-info {
58-
width: 334px;
58+
flex-grow: 1;
59+
max-width: 334px;
5960
input {
6061
border-radius: 3px;
6162
margin-left: 2px;
@@ -98,7 +99,7 @@
9899
flex-wrap: wrap !important;
99100
}
100101

101-
mat-label {
102+
label {
102103
width: 100%;
103104
text-align: left;
104105
margin-bottom: 8px;

src/app/layout/search/search.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { ApplicationRoutes } from '../../constants'
2222
})
2323
export class SearchComponent implements OnInit {
2424
labelSearch = $localize`:@@layout.ariaLabelSearch:Search the ORCID registry`
25-
labelSearchBy = $localize`:@@layout.ariaLabelSearchBy:Search by name, affiliation or ORCID iD`
2625
form: UntypedFormGroup
2726
platform: PlatformInfo
2827
signinRegisterButton = true

0 commit comments

Comments
 (0)