fix(dual-list-selector): animate tree expansion#7493
fix(dual-list-selector): animate tree expansion#7493mcoker merged 10 commits intopatternfly:mainfrom
Conversation
|
Preview: https://patternfly-pr-7493.surge.sh A11y report: https://patternfly-pr-7493-a11y.surge.sh |
andrew-ronaldson
left a comment
There was a problem hiding this comment.
Crushing these issues bruh!
|
@kmcfaul @thatblindgeye looks like dual list selector tree in react conditionally renders the nested items when they're expanded. I think that happens right here - https://github.com/patternfly/patternfly-react/blob/f8b21b594c90960305e3b58b723c1cff7a9decbb/packages/react-core/src/deprecated/components/DualListSelector/DualListSelectorTreeItem.tsx#L159 I think we'll need to either
Do you have a preference? Or any other thoughts? |
|
@mcoker gonna try fiddling around with React locally using this PR update, but at the moment I feel like personally I might lean towards making it more opt-in for React for now and updating in the next breaking change to be the default (similar to Alert).
|
|
@mcoker @kmcfaul I think I have something locally that may not require a setTimeout but still work. There is an issue with nested tree view items in the DLS component, though, and seems like it's also in Core. Toggling the |
|
I think I'd lean more towards a core solution with maybe an opt-in prop on react's side to allow the children to always be rendered, but I also think @thatblindgeye's solution avoiding the timeout and toggling the expanded class is good as well. The only issue I see is that the nested tree folders aren't being hidden when collapsed. |
|
@kmcfaul @thatblindgeye fixed the nested item bug and converted it to transition |
thatblindgeye
left a comment
There was a problem hiding this comment.
In React this looks great. The only thing is that by default (just the tree example as it curently is in React) the expand animation will still occur, but there's no collapse animation. Adding a hasAnimations prop and setting that up gets things working as expected, it's just the current behavior where the children are dynamically rendered rather than always rendered.
Would we be able to add a temporary class to disable animations for the current behavior, then in the next breaking change remove it (and the prop we'd need in React to get animations working)?
|
@thatblindgeye forgot about that! Added, |
thatblindgeye
left a comment
There was a problem hiding this comment.
insert magneto-perfection.gif
Looks like this should work in React!
| .#{$dual-list-selector}.pf-m-animate-expand & { | ||
| // stylelint-disable max-nesting-depth, selector-max-class | ||
| &:where([hidden]) { | ||
| display: flex; |
There was a problem hiding this comment.
I'm not following why this rule is needed. .#{$dual-list-selector}__list looks to be removed from the dom when in the unexpanded state.
There was a problem hiding this comment.
@sg00dwin good catch, that was a copy/paste from another component.
|
@sg00dwin if you're testing in react, it won't collapse because react removes the nested menu from the DOM on collapse. But that's going to change so that react always renders the element - @thatblindgeye and I have tested it on the react side so it should be GTG now! |
srambach
left a comment
There was a problem hiding this comment.
Just the one question about if we want to leave a breaking change comment for later.
| --#{$dual-list-selector}__item--PaddingInlineStart: var(--#{$dual-list-selector}__item--m-expandable--PaddingInlineStart); | ||
|
|
||
| > .#{$dual-list-selector}__list { | ||
| .#{$dual-list-selector}.pf-m-animate-expand & { |
There was a problem hiding this comment.
Do we want to leave a TODO anywhere about removing the opt-in in a breaking change?
|
🎉 This PR is included in version 6.3.0-prerelease.20 🎉 The release is available on: Your semantic-release bot 📦🚀 |

fixes #7325
fixes #7530