Skip to content

ScrollView: refactor default layout #531

Open
@FrancescoCioria

Description

@FrancescoCioria

requirements

ScrollView is fluid (width/height 100%) and this brings up a problem:

  • width/height 100% always refers to parent --> ScrollView doesn't take into account its children size
  • max-width/height always refers to parent's width/height --> putting max-width/height on parent is useless

Take the example of Menu in PanelMenu/ContextualMenu:

  • we want ScrollView to have the size of its content
  • we want ScrollView to stop at some point and enable scrolling (max-width/height)

That is currently impossible.

specs

we should consider refactoring ScrollVIew to have

  • width/height: auto (grow with content)

and one of these two:

  • have max-width/height: 100% (don't overflow parent)
  • have max-width/height: inherit (use parent's max-width/height --> throw warning if missing)

I may prefer the first one as max-width/height could always be overwritten with inline style through props (also, it's less magical)

...
...

or simply use FlexView and require the parent to be a column FlexView!

misc

This is a breaking change --> it'll probably break some points of current layout

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingIssues that introduce a breaking change that must be release with a new "major"in reviewIssues with an open PR waiting to be reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions