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.

[Stack] Using stack makes children full width by default

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Something seems to be a little fishy with the Stack component. The docs are showing that the children inside stack shouldn’t be full width but opening up CodeSandbox or Blitz that’s provided shows the children are full width by default. I know you can change the alignment to start or something, but not everyone knows how Flexbox works and the example doesn’t say anything about it

Expected behavior 🤔

Stack shouldn’t make children full width by default as the docs states.

Steps to reproduce 🕹

Steps:

  1. Read the docs
  2. Open the provided links to CodeSandbox or Blitz
  3. Notice the bug
  4. Be sad it’s the same in your own project

Context 🔦

No response

Your environment 🌎

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ImCheesecakecommented, Mar 13, 2022

@danilo-leal No I think this should be enough. Now when the demo and example looks the same it won’t get confusing! Closing the issue

0reactions
danilo-lealcommented, Mar 11, 2022

Ok, there you go. I managed to adjust the first example without having to deal with the Demo component.

@ImCheesecake Would you say that a “Stack’s children will render full-width by default” mention is still needed given that the demo in the docs and on CodeSanbox will look the same now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

First-child full-width in Flexbox - css - Stack Overflow
You can set the :first-child to a width of 100% , and the rest of the childs :not(:first-child) to flex: 1 . To...
Read more >
Flutter : Everything about Stack.. | by Parth Raval - ITNEXT
It works with a combination of parameters - vertical (top, bottom, height) and horizontal (left, right and width) to position the widgets within...
Read more >
Stack class - widgets library - Flutter - Dart API docs
A widget that positions its children relative to the edges of its box. This class is useful if you want to overlap several...
Read more >
React Stack component - Material UI - MUI
Stack is concerned with one-dimensional layouts, while Grid handles two-dimensional layouts. The default direction is column which stacks children vertically.
Read more >
StackPane (JavaFX 8) - Oracle Help Center
The stackpane will attempt to resize each child to fill its content area. ... The default alignment of children within the stackpane's width...
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