Skip to content

Commit

Permalink
fix animation prop that didn't do anything
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrekim committed Jan 23, 2025
1 parent 74d36e2 commit 92ba55e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const StepIndicatorProperties: PropertiesTableProps = {
status: 'optional',
},
no_animation: {
doc: 'If set to `true`, the height animation on the step items and the drawer button will be omitted. Defaults to `false`.',
doc: 'If set to `true`, the height animation on step change and list expansion will be omitted. Defaults to `false`.',
type: 'boolean',
status: 'optional',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ function StepIndicatorList() {
closeHandler,
countSteps,
data,
no_animation,
} = useContext(StepIndicatorContext)
const Element = mode === 'static' ? 'div' : 'nav'

const params = {}
skeletonDOMAttributes(params, skeleton)
return (
<HeightAnimation
animate={!no_animation}
open={openState}
onOpen={(state) => {
if (state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function StepIndicatorTriggerButton({
openHandler,
skeleton,
filterAttributes,
no_animation,
} = contextWithoutData

const item = data[activeStep || 0]
Expand Down Expand Up @@ -95,7 +96,7 @@ function StepIndicatorTriggerButton({
bottom: 'small',
}}
>
<HeightAnimation>
<HeightAnimation animate={!no_animation}>
<div {...(triggerParams as React.HTMLProps<HTMLDivElement>)}>
<span className="dnb-sr-only" id={id + '-overview'}>
{overview_title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function WizardContainer(props: Props) {
omitFocusManagement,
onStepChange,
children,
noAnimation = true,
noAnimation = false,
expandedInitially = false,
prerenderFieldProps = true,
...rest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const WizardContainerProperties: PropertiesTableProps = {
status: 'optional',
},
noAnimation: {
doc: 'Determines if the height animation for step items and the drawer button will run. Inherited from StepIndicator. Defaults to `true`.',
doc: 'If set to `true`, the height animation on step change and list expansion will be omitted. Inherited from StepIndicator. Defaults to `false`.',
type: 'boolean',
status: 'optional',
},
Expand Down

0 comments on commit 92ba55e

Please sign in to comment.