Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 0104d59

Browse files
committed
prettier
1 parent 1cb3a01 commit 0104d59

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

packages/accessibility/src/behaviors/Carousel/carouselItemBehavior.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const carouselItemBehavior: Accessibility<CarouselItemProps> = props => ({
1414
root: {
1515
role: props.navigation ? 'tabpanel' : 'group',
1616
'aria-hidden': props.active ? 'false' : 'true',
17-
tabIndex: props.navigation ? props.active ? 0 : -1 : -1,
17+
tabIndex: props.navigation ? (props.active ? 0 : -1) : -1,
1818
},
1919
},
2020

packages/react/src/components/Carousel/Carousel.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ class Carousel extends AutoControlledComponent<WithAsProp<CarouselProps>, Carous
184184
this.showPreviousSlide(e, true)
185185
},
186186
showNextSlideByPaddlePress: e => {
187-
e.preventDefault()
188-
this.showNextSlide(e, false)
187+
e.preventDefault()
188+
this.showNextSlide(e, false)
189189
},
190190
showPreviousSlideByPaddlePress: e => {
191191
e.preventDefault()
@@ -244,7 +244,7 @@ class Carousel extends AutoControlledComponent<WithAsProp<CarouselProps>, Carous
244244
<div style={styles.itemsContainerWrapper} {...accessibility.attributes.itemsContainerWrapper}>
245245
<div
246246
className={Carousel.slotClassNames.itemsContainer}
247-
aria-roledescription={ariaRoleDescription}
247+
aria-roledescription={ariaRoleDescription}
248248
aria-label="Portrait collection"
249249
style={styles.itemsContainer}
250250
{...accessibility.attributes.itemsContainer}
@@ -279,16 +279,20 @@ class Carousel extends AutoControlledComponent<WithAsProp<CarouselProps>, Carous
279279

280280
showPreviousSlide = (e: React.SyntheticEvent, focusItem: boolean) => {
281281
this.setActiveIndex(e, this.state.activeIndex - 1, focusItem)
282-
// if 'previous' paddle will disappear, will focus 'next' one.
283-
if (!this.props.navigation && this.state.activeIndex <= 1 && !this.props.circular) {
284-
this.paddleNextRef.current.focus()
285-
}
282+
// if 'previous' paddle will disappear, will focus 'next' one.
283+
if (!this.props.navigation && this.state.activeIndex <= 1 && !this.props.circular) {
284+
this.paddleNextRef.current.focus()
285+
}
286286
}
287287

288288
showNextSlide = (e: React.SyntheticEvent, focusItem: boolean) => {
289289
this.setActiveIndex(e, this.state.activeIndex + 1, focusItem)
290290
// if 'next' paddle will disappear, will focus 'previous' one.
291-
if (!this.props.navigation && this.state.activeIndex >= this.props.items.length - 2 && !this.props.circular) {
291+
if (
292+
!this.props.navigation &&
293+
this.state.activeIndex >= this.props.items.length - 2 &&
294+
!this.props.circular
295+
) {
292296
this.paddlePreviousRef.current.focus()
293297
}
294298
}

0 commit comments

Comments
 (0)