Skip to content

Commit 1af63fd

Browse files
fix(PDYE-1434): de focusWithin a focusVisible CourseList (#747)
Co-authored-by: Javiera Munita <javiera.munita@eclass.cl>
1 parent 34328e1 commit 1af63fd

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/organisms/CourseList/Boxes/BoxImage.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, LinkOverlay } from '@chakra-ui/react'
1+
import { Box, LinkBox, LinkOverlay } from '@chakra-ui/react'
22

33
import { vars } from '@theme'
44
import { Ripples } from '@atoms'
@@ -35,8 +35,12 @@ export function BoxImage({
3535
}
3636
return (
3737
<WithRipples enabled={isCourseActive(data?.action?.enabled ?? false, data?.Profile?.id)}>
38-
<Box
38+
<LinkBox
3939
className="CourseList-ImageBox"
40+
_focusVisible={{
41+
boxShadow: `0 0 0 3px ${vars('colors-alert-deepSkyBlue')} inset`,
42+
}}
43+
tabIndex={0}
4044
sx={{
4145
backgroundImage: `linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,1) 100%), url(${backgroundImg})`,
4246
color: vars('colors-neutral-white'),
@@ -52,12 +56,23 @@ export function BoxImage({
5256
margin: m,
5357
justifyContent: 'end',
5458
textAlign: 'left',
59+
60+
a: {
61+
'&:active': {
62+
boxShadow: 'none',
63+
},
64+
},
5565
}}
5666
>
5767
{!data?.hasFinanzeFreezed &&
5868
isCourseActive(data?.action?.enabled ?? false, data?.Profile?.id) && (
59-
<LinkOverlay href={data?.action?.href} isExternal={data?.action?.targetBlank} />
69+
<LinkOverlay
70+
href={data?.action?.href}
71+
isExternal={data?.action?.targetBlank}
72+
tabIndex={-1}
73+
/>
6074
)}
75+
6176
<Box className="textBox" bottom="20px" display="flex" flexDirection="column" gap="8px">
6277
<Box
6378
as="h2"
@@ -88,7 +103,7 @@ export function BoxImage({
88103
)
89104
)}
90105
</Box>
91-
</Box>
106+
</LinkBox>
92107
</WithRipples>
93108
)
94109
}

src/organisms/CourseList/Boxes/BoxTraditional.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ export function BoxTraditional({ data, modalPaymentText }: IBoxTraditional): JSX
4343
transition="box-shadow .3s"
4444
overflow="hidden"
4545
_hover={cssActive}
46-
_active={cssActive}
47-
_focusWithin={{
46+
_focusVisible={{
4847
boxShadow: `0 0 0 3px ${vars('colors-alert-deepSkyBlue')} inset`,
4948
}}
5049
tabIndex={0}

0 commit comments

Comments
 (0)