Code Monkey home page Code Monkey logo

react-drag-resize's People

Contributors

justqing00 avatar

Stargazers

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

Watchers

 avatar  avatar

react-drag-resize's Issues

Cannot read property 'key' of undefined

Facing issue while passing render div as children, if div are used at the same component its working fine

<DragResizeContainer
        className='resize-container'
        resizeProps={{
          minWidth: 10,
          minHeight: 10,
          enable: this.canResizable()
        }}
        onDoubleClick={this.clickScreen}
        layout={layout}
        dragProps={{ disabled: false }}
        onLayoutChange={this.onLayoutChange}
        scale={2}
      > 
        {
          this.props.children
        }
      </DragResizeContainer>

Changing height also changes y position

As it can be seen on onLayoutChange y position must not changed since we only update height.

Reproduce steps:

  1. Add console log to onLayoutChange to see difference
  2. Click draggable once
  3. Resize height
  4. Click draggable once

When you click draggable once, you will notice it will turn back to its original y position
image

TypeError: childMap is undefined | Uncaught TypeError: Cannot read property 'zIndex' of undefined

Hi

I'm pretty new to React, javascript and the way the api docs are displayed so I may simply be misreading the instructions, however I believe I may have a bug.

For reference, I've added this to my project using 'npm install react-drag-resize'.

So when I try to use this code

import React from 'react';
import ReactDOM from 'react-dom';
import DragResizeContainer, {DragResize} from 'react-drag-resize';

ReactDOM.render(
    <DragResizeContainer>
    <div></div>
</DragResizeContainer>, document.getElementById('root'));

I receive this error in chrome.

bundle.js:21557 Uncaught TypeError: Cannot read property 'zIndex' of undefined
    at DragResize.render (bundle.js:21557)
    at finishClassComponent (bundle.js:13336)
    at updateClassComponent (bundle.js:13313)
    at beginWork (bundle.js:13692)
    at performUnitOfWork (bundle.js:15660)
    at workLoop (bundle.js:15769)
    at HTMLUnknownElement.callCallback (bundle.js:4386)
    at Object.invokeGuardedCallbackDev (bundle.js:4425)
    at invokeGuardedCallback (bundle.js:4282)
    at performWork (bundle.js:15887)

It seems like its because 'childMap' is missing, did I misunderstand something in the usage of your component or is this a bug? I tried passing 'childMap' as a prop entry through DragResizeContainer however it doesn't appear to help.

Cheers

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.