Code Monkey home page Code Monkey logo

react-splitter's People

Contributors

geoffcox avatar v-jiepeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-splitter's Issues

2x2 implementation/idea question

Hi, love your work here. Do you have any guidance on how to implement a 2x2 grid where only the center point is draggable to handle the resizing?

kinda like this:
image

Can't override the overflow property

Hi, is it possible to override the default 'hidden' overflow property in the .react-split .full-content class?
I can't find a way to do it.
Thanks.

Splitter Type does not exist

I noticed in the Live Demo that splitterSize requires one to set the splitter type. How can this be done in react.js?

<Split splitterType="solid" splitterSize="50px" initialPrimarySize="70%" defaultSplitterColors={colors}>
           
</Split>

Error: Property 'splitterType' does not exist on type

Version: 2.1.2

Support in auto close/auto open to min/max size

Hello,
I want to add a button for auto close/auto open to min/max size.
Please add an API for:

  1. Adding a button (icon) on the top of the splitter line. In this case for auto close/auto open to min/max size.
    Using the renderSplitter prop - prevents calling the onClick handler of the added button.
  2. Logic of setting actual size internally, for supporting the above feature.

Regards,
Michael

Keep a React component mounted in Split

Hi, I have use Split with 2 heavy components with conditional rendering. Something like:

const entryContainer = (<EntryContainer key="EntryContainerID" />);
const folderContainer = (<FolderContainer key="FolderContainerID" />);

// There is only entryContainer displayed here (its not need split)
      if (props.isEntryInFullWidth) {
        return entryContainer;
      }

   return (
        <Split
          initialPrimarySize={mainSplitSize}
          minPrimarySize="250px"
          minSecondarySize="250px"
        >
{folderContainer}
{entryContainer}
      </Split>

In this case if props.isEntryInFullWidth is changed React will unmount entryContainer component: https://medium.com/@cowi4030/optimizing-conditional-rendering-in-react-3fee6b197a20
The only way to optimize rendering is to have on Split props: displayPrimary and displaySecondary in my case:

return (
        <Split
          initialPrimarySize={mainSplitSize}
          minPrimarySize="250px"
          minSecondarySize="250px"
         displayPrimary={!props.isEntryInFullWidth}
        >
{folderContainer}
{entryContainer}
      </Split>

This will render the same like this:

if (props.isEntryInFullWidth) {
        return entryContainer;
}

here: https://github.com/GeoffCox/react-splitter/blob/master/package/src/Split.tsx#L201

The main goal is to skip double entryContainer in JSX in order to not unmount this component on next rerendering.

Move package/README.md to the top folder?

Normally the home page of a project (<root>/README.md) has some relevant information about the project (how to install, all the docs if the library is small, sample code and so on), otherwise, it gives the feeling that it's an unfinished project.
I see that you already did this on NPM but not here.

Wrong cursor on hover

If you use vertical split and solid splitter the cursor on hover is horizontal instead of vertical.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.