Skip to content

Avoid setting display: none (zero-height) when renderer mode is 'always' #1063

@stewartadam

Description

@stewartadam

Is your feature request related to a problem? Please describe.
Following up on #397, setting renderer: 'always' works great for preserving the DOM (i.e. and scroll offsets) for the contents within the panel, however it still causes issues for many components that virtualize a viewport and have their own scrollbars, for example data tables.

Data tables like glide-data-grid will typically render at 100% of the available width and height, then manage their own scrollbars.

Setting display: none on panel hide causes them to get a resize event to 0x0, and disrupts the scrollbar position.

Describe the solution you'd like
Best I can tell visibility: hidden is just as effective as display: none and doesn't reset viewports.

Describe alternatives you've considered

When available, users can try to capture and restore the component's scroll position using hooks if they are made available, but this is not always the case.

Even when they are, getting them to trigger properly after the panel resize has occurred can be tricky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions