Skip to content

Commit 92aab57

Browse files
use button tag instead of div with role button
1 parent 83d6ea1 commit 92aab57

File tree

6 files changed

+15
-32
lines changed

6 files changed

+15
-32
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: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const HeaderConfig = ({ filters, setFilters }) => {
4646
};
4747
// Implemented only for fixing sonar cube errors
4848
const handleKeyDown = (e) => {
49-
if (e.key === 'Enter') {
49+
if (e.key === 'Enter' || e.key === ' ') {
5050
console.log(e);
5151
}
5252
};
@@ -136,18 +136,12 @@ export const HeaderConfig = ({ filters, setFilters }) => {
136136
setIsOpened={setIsMainFilterOpen}
137137
aria-label="Filter settings"
138138
>
139-
<div
140-
role="button"
141-
tabIndex={0}
142-
aria-haspopup="true"
143-
aria-expanded={isMainFilterOpen}
144-
aria-label="Filter icon"
139+
<button
145140
className={cx('filters-icon-container', {
146141
'with-applied': appliedFiltersCount,
147142
opened: isMainFilterOpen,
148143
})}
149144
onClick={() => {}}
150-
onKeyDown={handleKeyDown}
151145
>
152146
<div className={cx('header-config__filters--filter-icon-wrapper')}>
153147
<i className={cx('filter-icon')}>
@@ -157,7 +151,7 @@ export const HeaderConfig = ({ filters, setFilters }) => {
157151
{appliedFiltersCount ? (
158152
<span className={cx('filters-count')}>{appliedFiltersCount}</span>
159153
) : null}
160-
</div>
154+
</button>
161155
</Popover>
162156
</div>
163157
<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
@@ -29,7 +29,7 @@
2929
background-color: inherit;
3030

3131
&:hover {
32-
background-color: inherit;
32+
background-color: inherit !important;
3333
}
3434
}
3535

@@ -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: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,9 @@ export const TagList = ({ tags }) => {
100100
)}
101101
</div>
102102
{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-
>
103+
<button className={cx('tag-list__item', 'tag-list__item--count')} onClick={toggleExpanded}>
111104
+{count}
112-
</div>
105+
</button>
113106
) : null}
114107
</div>
115108
);

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)