Skip to content

Commit 47079de

Browse files
use button tag instead of div with role button
1 parent 83d6ea1 commit 47079de

File tree

6 files changed

+17
-44
lines changed

6 files changed

+17
-44
lines changed

app/src/pages/inside/productVersionPage/linkedTestCasesTab/filterBlock/filterBlock.jsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,9 @@ export const FilterBlock = ({ filters, clearAllFilters }) => {
3535
{filters.status && (
3636
<div className={cx('filter-block__status')}>
3737
{filters.status}
38-
<div
39-
role="button"
40-
tabIndex={0}
41-
aria-label="Close button"
42-
className={cx('filter-block__status-icon')}
43-
onClick={clearAllFilters}
44-
onKeyDown={(e) => {
45-
if (e.key === 'Enter') {
46-
clearAllFilters();
47-
}
48-
}}
49-
>
38+
<button className={cx('filter-block__status-icon')} onClick={clearAllFilters}>
5039
<CloseIcon />
51-
</div>
40+
</button>
5241
</div>
5342
)}
5443
<Button className={cx('filter-block__add-button')} icon={<PlusIcon />} variant="text">

app/src/pages/inside/productVersionPage/linkedTestCasesTab/filterBlock/filterBlock.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
align-items: center;
4444
width: 16px;
4545
height: 16px;
46+
padding: 0;
47+
border-width: 0;
48+
background-color: transparent;
4649
cursor: pointer;
4750

4851
svg {

app/src/pages/inside/productVersionPage/linkedTestCasesTab/headerConfig/headerConfig.jsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { useIntl } from 'react-intl';
2121
import { FilterFilledIcon, FilterOutlineIcon, Popover, Toggle } from '@reportportal/ui-kit';
2222

2323
import { SearchField } from 'components/fields/searchField';
24+
import { ENTER_KEY_CODE, SPACE_KEY_CODE } from 'common/constants/keyCodes';
2425

2526
import { messages } from './messages';
2627

@@ -46,7 +47,7 @@ export const HeaderConfig = ({ filters, setFilters }) => {
4647
};
4748
// Implemented only for fixing sonar cube errors
4849
const handleKeyDown = (e) => {
49-
if (e.key === 'Enter') {
50+
if (e.keyCode === ENTER_KEY_CODE || e.keyCode === SPACE_KEY_CODE) {
5051
console.log(e);
5152
}
5253
};
@@ -136,18 +137,12 @@ export const HeaderConfig = ({ filters, setFilters }) => {
136137
setIsOpened={setIsMainFilterOpen}
137138
aria-label="Filter settings"
138139
>
139-
<div
140-
role="button"
141-
tabIndex={0}
142-
aria-haspopup="true"
143-
aria-expanded={isMainFilterOpen}
144-
aria-label="Filter icon"
140+
<button
145141
className={cx('filters-icon-container', {
146142
'with-applied': appliedFiltersCount,
147143
opened: isMainFilterOpen,
148144
})}
149145
onClick={() => {}}
150-
onKeyDown={handleKeyDown}
151146
>
152147
<div className={cx('header-config__filters--filter-icon-wrapper')}>
153148
<i className={cx('filter-icon')}>
@@ -157,7 +152,7 @@ export const HeaderConfig = ({ filters, setFilters }) => {
157152
{appliedFiltersCount ? (
158153
<span className={cx('filters-count')}>{appliedFiltersCount}</span>
159154
) : null}
160-
</div>
155+
</button>
161156
</Popover>
162157
</div>
163158
<div className={cx('header-config__toggle')}>

app/src/pages/inside/productVersionPage/linkedTestCasesTab/headerConfig/headerConfig.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
align-items: center;
2626
gap: 13px;
2727

28-
&--search-input {
28+
& > &--search-input {
2929
background-color: inherit;
3030

3131
&:hover {
@@ -43,6 +43,9 @@
4343
justify-content: center;
4444
width: 57px;
4545
border-radius: 20px;
46+
border-width: 0;
47+
background-color: transparent;
48+
cursor: pointer;
4649

4750
&:focus-visible {
4851
outline: 2px solid var(--rp-ui-base-dark-topaz-main);

app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ export const TagList = ({ tags }) => {
6666
setIsExpanded((prevState) => !prevState);
6767
};
6868

69-
const handleKeyDown = (e) => {
70-
if (e.key === 'Enter') {
71-
toggleExpanded();
72-
}
73-
};
74-
7569
const isCounterButtonVisible = useMemo(() => count > 0 && !isExpanded, [count, isExpanded]);
7670

7771
return (
@@ -89,27 +83,15 @@ export const TagList = ({ tags }) => {
8983
</div>
9084
))}
9185
{isExpanded && (
92-
<Button
93-
className={cx('tag-list__item--button')}
94-
onClick={toggleExpanded}
95-
onKeyDown={handleKeyDown}
96-
variant="text"
97-
>
86+
<Button className={cx('tag-list__item--button')} onClick={toggleExpanded} variant="text">
9887
{formatMessage(messages.showLess)}
9988
</Button>
10089
)}
10190
</div>
10291
{isCounterButtonVisible ? (
103-
<div
104-
role="button"
105-
tabIndex={0}
106-
aria-label="Counter button"
107-
className={cx('tag-list__item', 'tag-list__item--count')}
108-
onClick={toggleExpanded}
109-
onKeyDown={handleKeyDown}
110-
>
92+
<button className={cx('tag-list__item', 'tag-list__item--count')} onClick={toggleExpanded}>
11193
+{count}
112-
</div>
94+
</button>
11395
) : null}
11496
</div>
11597
);

app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
padding-right: 7px;
7878
overflow: visible;
7979
cursor: pointer;
80+
background-color: transparent;
8081
color: var(--rp-ui-base-e-400);
8182
}
8283
}

0 commit comments

Comments
 (0)