Code Monkey home page Code Monkey logo

Comments (4)

jeaye avatar jeaye commented on August 13, 2024 3

This is still an issue and I vote for having :wrap as a keyword argument for these layout components.

from re-com.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 13, 2024

@skrat h-box and v-box are a layer over flexbox but they don't have direct support for wrapping. It hasn't ever been on our radar.

Untested: you might be able to add a flexbox :style to an h-box like {:flex-wrap: "wrap"}.

from re-com.

metasoarous avatar metasoarous commented on August 13, 2024

I just came up against this as well. It seems that adding :style {:flex-wrap "wrap"} doesn't work, because h-box and v-box use :flex-flow "row|column no-wrap", and :flex-flow takes precedence over a separate :flex-wrap declaration.

Of course, it's possible to pass :style {:flex-flow "row|column wrap"} as appropriate, but this feels a little silly; h-box and v-box already have row|column specified, so we're duplicating work there. Admittedly, it's not a lot of work, but it makes it more cumbersome to pass around style maps that you might want to share between h-box and v-box components.

I see two options here (aside from not doing anything and letting us hack around it):

  • Add a :wrap option to these components
  • Have v-box and h-box specify separate :flex-direction and default :flex-wrap separately, so that the user can override :flex-wrap through the :styles map, as you suggest.

While the former might look nice, the latter might lead to better composability using style maps.

from re-com.

MawiraIke avatar MawiraIke commented on August 13, 2024

I have created a PR #312 which should fix this issue. The PR allows users to use :wrap keyword in h-box and v-box.
In the case that :wrap keyword is not passed to re-com, the default of nowrap remains to avoid breaking changes for current use cases.

from re-com.

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.