Giter Site home page Giter Site logo

Comments (4)

Yarith avatar Yarith commented on August 15, 2024 2

I experimented a little bit with the ellie. I found out, that the buggyElement gets a flex-shrink: 1. If i understand it correctly, this gives it the height of the parent element. So if you set it to flex-shrink: 0 directly on the element it will work, but correctly only when combined with Element.height <| Element.px 200 and Element.height Element.shrink and ommited (means shrink). The flex-shrink should not be changed to zero for Element.height Element.fill.

I have written a short css which will override with flex-shrink: 0 for the vertical scrollbar cases inside Element.behindContent, Element.inFront, Element.below, Element.onLeft and Element.onRight. If the height is set to Element.fill it will not change anything. See the comment for explanation what it does.

/* Workaround for: https://github.com/mdgriffith/elm-ui/issues/326
   Any direct element inside Element.behindContent (.nb.bh) with a vertical scrollbar and is not filling in height 
   will again have the flex-shrink set to 0, which would be otherwise set to 1 by the .s.sby.e alone.
   This will also be applied for Element.inFront (.nb.fr), Element.below (.nb.b), Element.onLeft (.nb.ol), 
   Element.onRight (.nb.or).
*/
/* 2021-10-28 12:21: Added also rules for Element.scrollbars (.sb), 
   because .sby is only for Element.scrollbarY. I think for 
   Element.scrollbarX is no fix necessary. */
    .nb.bh > .s.sby.e:not(.hf),
    .nb.bh > .s.sb.e:not(.hf),
    .nb.fr > .s.sby.e:not(.hf),
    .nb.fr > .s.sb.e:not(.hf),
    .nb.b > .s.sby.e:not(.hf),
    .nb.b > .s.sb.e:not(.hf),
    .nb.ol > .s.sby.e:not(.hf),
    .nb.ol > .s.sb.e:not(.hf),
    .nb.or > .s.sby.e:not(.hf),
    .nb.or > .s.sb.e:not(.hf)
    {
      flex-shrink: 0;
    }

See the updated ellie with the workaround applied here: https://ellie-app.com/fH9XjxS9mw5a1

I have not tested this outside of this ellie and have not checked if it would break other stuff.

At this point of writing i remembered about the Element.minimum and Element.maximum. If you set it to Element.height <| Element.minimum 200 Element.shrink or with Element.fill it works also without the workaround. Also for Element.maximum. The css workaround above is also not applied in those cases. Maybe the correct fix could also lay around flex-grow, which is set to 100000 by .nb.e > .hf in those cases. I have no experience in the flex system, so i can not tell. The only thing i saw, was, that without vertical scrollbar the element has flex-shrink: 0.

from elm-ui.

Yarith avatar Yarith commented on August 15, 2024 1

I have updated the css in my post above. It has only worked with Element.scrollbarY (.sby) and not Element.scrollbars (.sb). I see in your screenshots, that you have used Element.scrollbars. Seems so, that i forgot to test it with Element.scrollbars yesterday. The new css should fix it also for your case. I think for Element.scrollbarX (.sbx) is no code/fix necessary.

from elm-ui.

staeter avatar staeter commented on August 15, 2024

The fix doesn't work in my specific use-case. The flex-shrink: 1 is higher priority.

Screenshot 2021-10-28 at 11 34 50

Screenshot 2021-10-28 at 11 32 05

The simplest way I found to fix it was to give Html.Attributes.style "flex-shrink" "0" |> Element.htmlAttribute to every element with Element.scrollbarY or Element.scrollbars.

Screenshot 2021-10-28 at 11 48 54

from elm-ui.

staeter avatar staeter commented on August 15, 2024

Yes the fix works fine now thanks @Yarith !

from elm-ui.

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.