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

Wrapping a Pane in a custom React.Component prevents sorting #231

Open
fijiwebdesign opened this issue Feb 27, 2019 · 0 comments
Open

Wrapping a Pane in a custom React.Component prevents sorting #231

fijiwebdesign opened this issue Feb 27, 2019 · 0 comments

Comments

@fijiwebdesign
Copy link

fijiwebdesign commented Feb 27, 2019

Bug

Overview of the problem

I'm using react-sortable-pane ^1.0.0 and ^1.0.4
My browser is: Tested Chrome and Safari
I am sure this issue is not a duplicate

https://codesandbox.io/s/66367ox0z

Description

Passing a custom React.Component instead of <Pane> as children of <SortablePane> will prevent sorting the Panes.

Steps to Reproduce

I modified the initial example to:

function PaneItem({ key }) {
  return (
    <Pane
      key={key}
      defaultSize={{ width: "100%", height: 120 }}
      style={paneStyle}
    >
      <p style={textStyle}>00{key}</p>
    </Pane>
  );
}

export default function SimpleVertical() {
  const panes = [0, 1, 2].map(key => <PaneItem key={key} />);
  return (
    <div style={{ padding: "10px" }}>
      <SortablePane direction="vertical" margin={20}>
        {panes}
      </SortablePane>
    </div>
  );
}

Expected behavior

You should be able to pass a React.Component that wraps a <Pane>.

Actual behavior

No sorting available. The CSS shows the Panes are position:relative instead of position:absolute

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

No branches or pull requests

1 participant