Skip to content

Commit

Permalink
fix(ariaSelectedAttributeRemoval): Added logic to use keyboard events…
Browse files Browse the repository at this point in the history
… and click
  • Loading branch information
jarvisraymond-uchicago committed Nov 22, 2024
1 parent 27c98dd commit 7d7f086
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
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;
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 };

0 comments on commit 7d7f086

Please sign in to comment.