-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ariaSelectedAttributeRemoval): Added logic to use keyboard events…
… and click
- Loading branch information
1 parent
27c98dd
commit 7d7f086
Showing
2 changed files
with
18 additions
and
21 deletions.
There are no files selected for viewing
34 changes: 17 additions & 17 deletions
34
...ysis/SharedUtils/AccessibilityUtils/AntDAccessibilityFixes/Fixes/FixPaginationDropdown.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
const handlePaginationDropdownClick = () => { | ||
RemoveDOMAttribute( | ||
'.ant-select-item-option-active', | ||
'aria-selected', | ||
); | ||
RemoveDOMAttribute( | ||
'.ant-select-item', | ||
'aria-selected', | ||
); | ||
}; | ||
import isEnterOrSpace from '../../IsEnterOrSpace'; | ||
import RemoveDOMAttribute from '../Utils/RemoveDOMAttribute'; | ||
|
||
const FixPaginationDropDown = () => { | ||
const pageDropdown = document.querySelector('.ant-pagination-options-size-changer'); | ||
if (pageDropdown) { | ||
pageDropdown.addEventListener('click', handlePaginationDropdownClick); | ||
} | ||
}; | ||
|
||
export default FixPaginationDropDown; | ||
const pageDropdown = document.querySelector( | ||
'.ant-pagination-options-size-changer' | ||
); | ||
if (pageDropdown) { | ||
pageDropdown.addEventListener('click', () => { | ||
RemoveDOMAttribute('.ant-select-item', 'aria-selected'); | ||
}); | ||
pageDropdown.addEventListener('keydown', function (event) { | ||
if (isEnterOrSpace(event)) { | ||
RemoveDOMAttribute('.ant-select-item', 'aria-selected'); | ||
} | ||
}); | ||
} | ||
}; | ||
export default FixPaginationDropDown; |
5 changes: 1 addition & 4 deletions
5
src/Analysis/SharedUtils/AccessibilityUtils/AntDAccessibilityFixes/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import DelayExecution from './Utils/DelayExecution'; | ||
import FixPaginationDropDown from './Fixes/FixPaginationDropdown'; | ||
|
||
|
||
const AntDTableAccessibilityFix = () => { | ||
export const AntDTableAccessibilityFix = () => { | ||
DelayExecution(FixPaginationDropDown); | ||
}; | ||
|
||
export { AntDTableAccessibilityFix }; |