This component is used to generate a scrollable section of a panel It will take a couple of parameters to customize it, but it will display the scrollbar and format it
Basic Usage:
<FwPanelScrollable @maxHeight='200px' @hideOnMouseLeave={{false}} @scrollbarThickness='thin'>
{{!...stuff to be in the panel}}
</FwPanelScrollable>
Advanced Usage Notes:
This scrollable panel works in a difficult way with power-select, so it needs special attention in order to work properly.
If not configured properly, power select drop down menu will be clipped and hidden underneath the scrollable panel. This has to do with the renderInPlace=true
on the power select, which is there to make it work with modals. Here is the fix:
- Scenario 1. If you are NOT in a modal, simply remove
@renderInPlace={{true}}
from the power select, and it will work again. - Scenario 2. If you ARE in a modal, you have a few steps.
- Remove
@renderInPlace={{true}}
from the power select - The line above the FwPanelScrollable, put the following code:
<div id="uniqueDivId"></div>
- Then in the PowerSelect component write add the attribute,
@destination="uniqueDivId"
. - Finally, in your FwFullscreenModal component, add the attribute:
@scrollTopReturn=true
.
- Remove
With these four steps, the PowerSelect should be working in modals perfectly as well.
Methods
hideOnMouseLeave
BooleanIf this is true, the scrollbar will only show whenever the mouse is hovering over the panel and when it is not, it will be hidden. Otherwise, the scrollbar will appear all the time.
Default: false
maxHeight
StringThis takes a CSS string for height (meaning a number with the units px, em, or even vh would work). It gives the maximum height allowed before the scrollbar appears. Note: on a regular modal (with the normal header and footer and just a scrollable panel), setting the section to have a scrollable panel of height 67vh (viewport height) is the perfect size fit for any screen. If you add things outside the scrollable panel, playing with this might be helpful.
Default: '200px'
scrollbarThickness
StringThis sets the thickness that the scrollbar will appear. Options: thin, medium, and thick. Note: on Firefox, medium and thick appear the same, only Chrome displays a difference between these two.
Default: 'thin'
scrollBottom
BooleanIf true, this sets the positioning of the scrollbar to start at the bottom of the scrollable content. Otherwise, it starts the scrollbar at the top as normal.
Default: false