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

Feature: Add revert Prop to Reverse Pane Order #229

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zelytra
Copy link

@zelytra zelytra commented Feb 27, 2025

This pull request introduces a new revert prop to the splitpanes component. When enabled, the component reverses the order of its panes (e.g., from [1, 2, 3] to [3, 2, 1]), providing developers with an easy way to alter the layout without needing to restructure the markup manually.

Background

Previous attempts to invert the pane order using only CSS proved insufficient because the pane resize calculations were not inverted accordingly. This discrepancy led to incorrect behavior during resize operations, as detailed in issues #216 and #148.

Key Changes

  • Props : Add an optional prop revert, defaulting to false.
  • Render Function: Modified the render function to check for the revert prop. When true, it reverses the order of the slot children.
  • CSS Class: Added the splitpanes--reverse CSS class to indicate the reversed state, which can be used for additional styling if necessary.

These changes are opt-in and maintain backward compatibility. Please review the modifications and merge if they meet the project requirements.

Fix #216
Fix #148

@zelytra zelytra changed the title Add a revert props to pane Feature: Add revert Prop to Reverse Pane Order Feb 27, 2025
@zelytra zelytra marked this pull request as ready for review February 27, 2025 22:54
@zelytra
Copy link
Author

zelytra commented Mar 3, 2025

Hello @antoniandre ! Do you have some times so check this PR ?

Sign up for free to 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.

Changing the order of the horizontal pan Reverse order of panes with custom components?
1 participant