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

Disable carousel autoadvance #957

Closed
PeterBreen opened this issue Apr 3, 2023 · 0 comments · Fixed by #962
Closed

Disable carousel autoadvance #957

PeterBreen opened this issue Apr 3, 2023 · 0 comments · Fixed by #962
Assignees
Labels
accessibility Issues identified by accessibility team or involving accessibility changes Front End Primarily front-end (react/javascript) javascript Pull requests that update Javascript code SMALL

Comments

@PeterBreen
Copy link
Collaborator

PeterBreen commented Apr 3, 2023

Per the accessibility team, we should disable the carousel automatic advance, meaning the only way to advance a slide is manually.

Our version of react-bootstrap (1.6, using Bootstrap 4.x) may not support interval={null} to disable autoadvance; that seems to be a react-bootstrap 2.x/Bootstrap 5.x function. However, if we can use null, let's do so.

To close this item, two things are required:

  • remove the ability to set a custom interval via props for the carousel components
  • remove any props.intervals from instances of those components.
  • test that carousels effectively do not auto advance, and only change slides on user action (clicking the arrow)

If interval={null} does not work, set interval={315569520000}. When I discussed this with the accessibility team, they allowed as how users are probably not going to wait ten years for a slide to advance. ;)

We have two Carousel components which need work: TestimonialCarousel and BlogCarousel.

code locations

First, remove the logic allowing for custom intervals and simply have it set it to interval={null}, then remove interval from our type statement; we won't accept custom values via props anymore.

TestimonialCarousel:

BlogCarousel:

Second, remove any use of props.interval:

Third and finally, remove props.interval from this component which doesn't use it and really doesn't need it declared. This is just a cleanup task, but it's worth doing:

In short, set Carousels to have no autoadvance interval and remove support for custom autoadvance intervals.

reference documentation

https://react-bootstrap-v4.netlify.app/components/carousel/

@PeterBreen PeterBreen added javascript Pull requests that update Javascript code Front End Primarily front-end (react/javascript) SMALL accessibility Issues identified by accessibility team or involving accessibility changes labels Apr 3, 2023
@SleeplessRegina SleeplessRegina self-assigned this Apr 8, 2023
@marlonkeating marlonkeating linked a pull request Apr 13, 2023 that will close this issue
SleeplessRegina added a commit that referenced this issue Apr 23, 2023
…elAutoAdvance

Xuanying #957 disable carousel auto advance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Issues identified by accessibility team or involving accessibility changes Front End Primarily front-end (react/javascript) javascript Pull requests that update Javascript code SMALL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants