Skip to content

Disables transition on AvatarStack children that are added after initial render - #3709

Merged
mperrotti merged 4 commits into
mainfrom
mp/avatarstack-disable-expand-bugfix
Sep 6, 2023
Merged

Disables transition on AvatarStack children that are added after initial render#3709
mperrotti merged 4 commits into
mainfrom
mp/avatarstack-disable-expand-bugfix

Conversation

@mperrotti

Copy link
Copy Markdown
Contributor

Only applies transition property when disableExpand is not passed.

Closes#3688

Screenshots

Kapture.2023-09-05.at.13.49.32.mp4

Merge checklist

  • Added/updated tests
  • [n/a] Added/updated documentation
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@mperrotti
mperrotti requested review from a team and joshblackSeptember 5, 2023 17:51
@changeset-bot

changeset-botBot commented Sep 5, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ab19031

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mperrotti
mperrotti requested a review from gr2mSeptember 5, 2023 17:51
@mperrotti

Copy link
Copy Markdown
ContributorAuthor

If you want to test these changes locally, you can replace the DisableExpandOnHover story with this:

exportconstDisableExpandOnHover=()=>{constsrcArr=['https://avatars.githubusercontent.com/primer','https://avatars.githubusercontent.com/github','https://avatars.githubusercontent.com/atom','https://avatars.githubusercontent.com/desktop',]const[avatarSrcs,setAvatarSrcs]=React.useState([])constaddAvatar=()=>{setAvatarSrcs([...avatarSrcs,srcArr[avatarSrcs.length%srcArr.length]])}constremoveAvatar=()=>{setAvatarSrcs(avatarSrcs.slice(0,avatarSrcs.length-1))}return(<divstyle={{display: 'flex',flexDirection: 'column',gap: '1em',alignItems: 'flex-start'}}><divstyle={{display: 'flex',gap: '0.5em'}}><ButtononClick={addAvatar}>Add avatar</Button><ButtononClick={removeAvatar}>Remove avatar</Button></div><div><AvatarStackdisableExpand>{avatarSrcs.map(src=>(<Avataralt="Some avatar"src={src}key={src}/>))}</AvatarStack></div></div>)}

@github-actions

github-actionsBot commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js100.62 KB (-0.01% 🔽)
dist/browser.umd.js101.19 KB (-0.01% 🔽)

@github-actions
github-actionsBot temporarily deployed to storybook-preview-3709 September 5, 2023 18:00 Inactive
@mperrotti
mperrotti temporarily deployed to github-pages September 5, 2023 18:03 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-3709 September 5, 2023 18:03 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-3709 September 6, 2023 14:17 Inactive
@mperrotti
mperrotti added this pull request to the merge queueSep 6, 2023
Merged via the queue into main with commit edc0168Sep 6, 2023
@mperrotti
mperrotti deleted the mp/avatarstack-disable-expand-bugfix branch September 6, 2023 14:29
@primerprimerBot mentioned this pull request Sep 6, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AvatarStack: disableExpand does not disable animation when Avatar components within are changed

2 participants

@mperrotti@joshblack