question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Overflow to prop aliases

See original GitHub issue

Why:

Consider this common mobile layout:

const template = `
  header
  content
  footer
`
const C = () => (
  <Composition
    template={template}
    templateRows='auto 1fr auto'
    height='100vh'>
    {({ Header, Content, Footer }) => (
      <>
        <Header/>
        <Content/>
        <Footer/>
      </>
    )}
  </Composition>
)

Now say we want the Content area to be vertically scrollable - this means that the Content div needs to have overflow-y: scroll in it’s style.

Without top-level support for overflow we would need to apply the style inside the FaaC.

Why I think this is a good candidate: Quite simply - I believe scroll is a layout concern; it’s not styling.

How:

Add the following prop aliases to the Box component.

alias: overflowY
type: string
mapping: {
  undefined: `overflow-y: auto`
  [value]: `overflow-y: ${value}`
}

alias: overflowX
type: string
mapping: {
  undefined: `overflow-x: auto`
  [value]: `overflow-y: ${value}`
}

alias: overflow
type: string
mapping: {
  undefined: `overflow: auto`
  [value]: `overflow: ${value}`
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kettanaitocommented, Mar 12, 2019

Glad that helped. I’m closing this issue in favor of #126. overflow CSS properties will be added as a part of pre-configured prop aliases packs once the referred API lands. Feel free to suggest more useful aliases in that issue.

Thank you once more for contributing!

1reaction
innerdazecommented, Mar 12, 2019

ahh that’s ideal, thanks - I hadn’t realised this was possible

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add an alias for a property in JavaScript - Stack Overflow
defineProperty() method defines a new property directly on an object, or modifies an existing property on an object, and returns the object.
Read more >
Why hooks are the best thing to happen to React
React hooks have made performing these functionalities much easier by providing an avenue for simpler, more composable, flexible, and extendable ...
Read more >
The Most Asked TypeScript Questions on StackOverflow
Almost all features of an interface are available via type aliases, except you cannot add new properties to a type by re-declaring it....
Read more >
CSS reference - CSS: Cascading Style Sheets - MDN Web Docs
Note: The property names in this index do not include the JavaScript names where they differ from the CSS standard names.
Read more >
Dropdown | Components - BootstrapVue
<b-dropdown> (or known by its shorter alias of <b-dd> ) components are ... of the parent container too, add the w-100 utility class...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found