Giter VIP home page Giter VIP logo

Comments (5)

bokuweb avatar bokuweb commented on May 26, 2024 2

@zalmoxisus thanks!!

@barbalex thanks your request.
I made a simple example.

import React, { Component } from 'react';
import { SortablePane, Pane } from '../../src';

const style = {
  fontSize: '40px',
  textAlign: 'center',
  height: '100%',
  border: 'solid 1px #ccc',
  borderRadius: '5px',
  backgroundColor: '#fff',
};

export default class Example extends Component {
  constructor(props) {
    super(props);
    this.state = { width: [400, 400] };
  }

  onResize({id, size}) {
    let width = [];
    width[id] = size.width;
    width[(id+1)%2] = 800 - size.width;
    this.setState({ width });
  }

  render() {
    return (
      <div style={{ width: '800px', height: '600px' }}>
        <SortablePane
          direction="horizontal"
          margin={10}
          onResize={::this.onResize}
        >
        <Pane
          id={0}
          ref="pane0"
          width={this.state.width[0]}
          height={600}
          style={style}
        />
        <Pane
          id={1}
          ref="pane1"
          width={this.state.width[1]}
          height={600}
          style={style}
        />
        </SortablePane>
      </div>
    );
  }
}

screenshot

But, position not updated properly.
This component is not suitable...
I think it is looks good better to implemented as another component.

I'm going to create such components.
But this tasks that take a long time to complete.
https://github.com/bokuweb/react-sortable-split

from react-sortable-pane.

barbalex avatar barbalex commented on May 26, 2024 2

thanks for great tools and stellar help :-)

from react-sortable-pane.

zalmoxisus avatar zalmoxisus commented on May 26, 2024 1

Related to #20.

from react-sortable-pane.

barbalex avatar barbalex commented on May 26, 2024

thanks a lot
will watch your projects
in the meantime I am reverting to a simple solution without split

from react-sortable-pane.

bokuweb avatar bokuweb commented on May 26, 2024

@barbalex sorry... I'll do my best.

from react-sortable-pane.

Related Issues (20)

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.