Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(slider): changed the properties that were generating an error in… #115

Merged
merged 6 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions react/components/Arrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useContextCssHandles } from '../modules/cssHandles'
interface Props {
custom?: ReactNode
orientation: 'left' | 'right'
controls: string
totalItems: number
infinite: boolean
arrowSize: number
Expand All @@ -24,7 +23,6 @@ export const CSS_HANDLES = [
const Arrow: FC<Props> = ({
custom,
orientation,
controls,
totalItems,
infinite,
arrowSize,
Expand Down Expand Up @@ -71,7 +69,7 @@ const Arrow: FC<Props> = ({
} absolute transparent ma2 flex items-center justify-center bn outline-0 pointer`}
style={{ background: 'transparent' }}
onClick={handleArrowClick}
aria-controls={controls}
role="button"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Você acha que esse role="button" é necessário?

Eu acho que todo elemento button por padrão já herda esse role de button.

CleanShot 2023-10-31 at 14 43 59

aria-label={`${orientation === 'left' ? 'Previous' : 'Next'} Slide`}
disabled={disabled}
>
Expand Down
6 changes: 2 additions & 4 deletions react/components/PaginationDots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useSliderControls } from '../hooks/useSliderControls'
const DOTS_DEFAULT_SIZE = 0.625

interface Props {
controls: string
totalItems: number
infinite: boolean
}
Expand Down Expand Up @@ -41,7 +40,7 @@ const getSlideIndices = (
]
: []

const PaginationDots: FC<Props> = ({ controls, totalItems, infinite }) => {
const PaginationDots: FC<Props> = ({ totalItems, infinite }) => {
const { slidesPerPage, currentSlide, navigationStep } = useSliderState()
const { goBack, goForward } = useSliderControls(infinite)
const { handles, withModifiers } = useContextCssHandles()
Expand Down Expand Up @@ -96,11 +95,10 @@ const PaginationDots: FC<Props> = ({ controls, totalItems, infinite }) => {
width: `${DOTS_DEFAULT_SIZE}rem`,
}}
key={index}
tabIndex={index}
tabIndex={0}
onKeyDown={event => handleDotClick(event, index)}
onClick={event => handleDotClick(event, index)}
role="button"
aria-controls={controls}
aria-label={`Dot ${index + 1} of ${slideIndexes.length}`}
data-testid="paginationDot"
/>
Expand Down