Comments (4)
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.
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.
The fix doesn't work in my specific use-case. The flex-shrink: 1
is higher priority.
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.
from elm-ui.
Yes the fix works fine now thanks @Yarith !
from elm-ui.
Related Issues (20)
- Docs' paragraph example image 404s
- Some elements don't get style applied HOT 2
- Tooltips? HOT 1
- Element.modular math is wrong (easy fix provided)
- Input.slider doesn't respond to mouseOver HOT 1
- Why are some of the events functions like onMouseCoords not exported?
- Feature request: from Html.Styled HOT 1
- Make text unselectable? HOT 2
- CSP nonce support (to be able to protect against XSS attacks)
- Feature request: batch attributes together HOT 2
- Feature request: add attributes retroactively HOT 1
- Feature request: attribute 'none' HOT 1
- Add a function similar to ZStack in SwiftUI HOT 3
- Canvas inside Element HOT 1
- Below attribute adds a z-index of 20 and thus jumps in front of everything
- Enable custom styling for elements which are both focused and hovered
- Serialize elm-ui to json
- Pseudo-classes are triggered randomly (hover/mouseOver, focus/focused, active/mouseDown) HOT 1
- New Chrome warning: The keyword 'slider-vertical' specified to an 'appearance' property is not standardized. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-ui.