Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
857cde8e
Unverified
Commit
857cde8e
authored
Feb 13, 2020
by
Kyle Keating
Committed by
GitHub
Feb 13, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1779 from hypothesis/a11y-tag-editor-fix
Fix AutocompleteList aria-selecterd prop
parents
954286d7
661488dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
autocomplete-list.js
src/sidebar/components/autocomplete-list.js
+1
-1
autocomplete-list-test.js
src/sidebar/components/test/autocomplete-list-test.js
+8
-5
No files found.
src/sidebar/components/autocomplete-list.js
View file @
857cde8e
...
...
@@ -34,7 +34,7 @@ export default function AutocompleteList({
<
li
key
=
{
`autocomplete-list-
${
index
}
`
}
role
=
"option"
aria
-
selected
=
{
activeItem
===
index
}
aria
-
selected
=
{
(
activeItem
===
index
).
toString
()
}
className
=
{
classnames
(
{
'is-selected'
:
activeItem
===
index
,
...
...
src/sidebar/components/test/autocomplete-list-test.js
View file @
857cde8e
...
...
@@ -146,19 +146,22 @@ describe('AutocompleteList', function() {
);
});
it
(
'sets the `aria-selected` attribute
on the active index
'
,
()
=>
{
it
(
'sets the `aria-selected` attribute
to "true" on the active item and "false" for all others
'
,
()
=>
{
const
wrapper
=
createComponent
({
open
:
true
,
activeItem
:
0
});
assert
.
isTrue
(
assert
.
equal
(
wrapper
.
find
(
'li'
)
.
at
(
0
)
.
prop
(
'aria-selected'
)
.
prop
(
'aria-selected'
),
'true'
);
assert
.
isFalse
(
assert
.
equal
(
wrapper
.
find
(
'li'
)
.
at
(
1
)
.
prop
(
'aria-selected'
)
.
prop
(
'aria-selected'
),
'false'
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment