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

feat: add classname split-view-sash-dragging to top-level container #536

Merged
merged 2 commits into from Feb 2, 2023
Merged

Conversation

percy507
Copy link
Contributor

The split-view-sash-dragging classname will be useful to add animation for pane when toggle the visibility of pane.

@netlify
Copy link

netlify bot commented Jan 29, 2023

Deploy Preview for allotment-storybook ready!

Name Link
🔨 Latest commit dd2ab68
🔍 Latest deploy log https://app.netlify.com/sites/allotment-storybook/deploys/63d6330fe557b100091c0d76
😎 Deploy Preview https://deploy-preview-536--allotment-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jan 29, 2023

Deploy Preview for allotment-website canceled.

Name Link
🔨 Latest commit dd2ab68
🔍 Latest deploy log https://app.netlify.com/sites/allotment-website/deploys/63d6330fd8d83e000929efd3

@johnwalley
Copy link
Owner

The split-view-sash-dragging classname will be useful to add animation for pane when toggle the visibility of pane.

Thanks for the PR. Looks like a good improvement! I'll take a proper look in the next few days and get this released 👍

@johnwalley johnwalley added the enhancement New feature or request label Feb 2, 2023
@johnwalley johnwalley self-requested a review February 2, 2023 16:34
@johnwalley johnwalley changed the title Add classname split-view-sash-dragging for top-level container feat: add classname split-view-sash-dragging to top-level container Feb 2, 2023
@johnwalley johnwalley merged commit a59c774 into johnwalley:main Feb 2, 2023
@livwvil
Copy link

livwvil commented Jun 27, 2023

There is a visual flaw with this approach. Panels are always in an animated state. This can be seen in related story if you change the size of the container. This side effect is not acceptable in my application. By sacrificing an additional renderer, I had to solve a similar problem like this:

  const [animated, setAnimated] = useAutoResetter(false, 150);

  const setExpanded = useCallback(
    (id: SectionsItem['id'], isExpanded: boolean) => {
      expand(sidebarId, id, isExpanded);
      setAnimated(true);
    },
    [expand, setAnimated],
  );
  
<Allotment.Pane
  key={item.id}
  className={classNames(animated && 'transition-all')}
  preferredSize={item.preferredSize}
  minSize={isExpanded ? EXPANDED_MIN_HEIGHT : COLLAPSED_MIN_HEIGHT}
  maxSize={isExpanded ? Infinity : COLLAPSED_MIN_HEIGHT}
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants