GithubHelp home page GithubHelp logo

Comments (3)

Hypnosphi avatar Hypnosphi commented on May 15, 2024 7

None of these points answer, why a custom container couldn't be provided as an optional prop

from react-sortable-hoc.

clauderic avatar clauderic commented on May 15, 2024

There are a number of reasons for this, but long story short, it causes a lot more headaches than it solves. The challenges that arise when you try to append the element to the container instead of the body greatly outweigh the small benefits you get. Inevitably you end up needing a wrapper div to solve some of these challenges, which wouldn't make this component a HOC anymore. Feel free to try it for yourself :)

Also:

  • If you add the helper to it's container, it's susceptible to being hidden by overflow: scroll or overflow:hidden.
  • There are a number of css glitches in Safari on iOS related to fixed positioning nested elements.
  • Sometimes adding the helper to the container is simply not an option in the context of a HOC, for instance, if you're enhancing a react-virtualized or react-infinte list, nevermind the fact that touch events stop firing when the e.target gets removed from the DOM.

If you're using css-modules (if not, you should really give it a shot), this isn't really an issue either.

from react-sortable-hoc.

zaygraveyard avatar zaygraveyard commented on May 15, 2024

I see, thank you for this explanation.

from react-sortable-hoc.

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.