feature(itinerary-body): Add shouldAnimate param on all use of AnimateHeight#511
Open
noletorious wants to merge 1 commit intomasterfrom
Open
feature(itinerary-body): Add shouldAnimate param on all use of AnimateHeight#511noletorious wants to merge 1 commit intomasterfrom
noletorious wants to merge 1 commit intomasterfrom
Conversation
miles-grant-ibigroup
requested changes
Dec 19, 2022
Collaborator
miles-grant-ibigroup
left a comment
There was a problem hiding this comment.
Thanks for this change, I agree that we should respect prefers-reduce-motion. Do you think it's possible to do this inside of this component instead of exposing a new prop?
| {/* IntermediateStops expanded body */} | ||
| <AnimateHeight duration={500} height={stopsExpanded ? "auto" : 0}> | ||
| <AnimateHeight | ||
| duration={shouldAnimate ? 500 : 0} |
Contributor
There was a problem hiding this comment.
since you're doing this check multiple times, you could assign the value to variable outside the mark-up and then re-use as a prop for the instances of AnimateHeight, something like:
const animationDuration = shouldAnimate ? 500 : 0;
<AnimateHeight duration={animationDuration} />
Contributor
|
@noletorious sorry for taking so long to review this, forgot I was assigned. Where do you stand on this work, are you able to address Miles' comment? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The intent behind conditionally animating collapsing content is to help address accessibility concerns around when the user wants to toggle motion off via their operating systems settings. More information on prefers-reduce-motion.