I am trying to contain/put a fin-hypergrid
within a web component, but because it's scrollbars are custom div
s with position: absolute
on them, they are positioned absolute to the window
rather that the component itself.
Here is my jsfiddle: https://jsfiddle.net/50kyyfam/
I'm almost certain I need to add a css properties to the :host
style to tell the grid to position absolute to the boundary of the data-grid
component, but I don't know what it should be?
EDIT: As a side note, if any of the fin-hypergrid
are looking, the minified version of core threw an exception when initialising the above jsfiddle. (Chrome 63)
To position an absolutely positioned element relative to its containing element,
position: relative
should be declared on that containing element, e.g:Updated JSFiddle
To expand upon, for the sake of clarity and for the potential benefit of any other possible readers:
absolute
orfixed
) you are removing the element from the natural document flow; which simply means the element is no longer interacting with sibling elements in the wayrelative
orstatic
elements do (imagine the element "siting above" the rest of the DOM).left
orright
property values it'll move a distance equal to the property value from the window. You can position an element with aposition
property value ofabsolute
(notfixed
) relative to any containing element if you declare relative positioning to that containing element.