Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack horizontal not working #3089

Open
1 of 6 tasks
TomSwift opened this issue Sep 11, 2023 · 3 comments
Open
1 of 6 tasks

Stack horizontal not working #3089

TomSwift opened this issue Sep 11, 2023 · 3 comments

Comments

@TomSwift
Copy link

TomSwift commented Sep 11, 2023

Willing to submit a PR to fix?

  • I am willing to submit a PR to fix

Requested priority

None

Products/applications affected

fluentui-react-native, Stack component

Package version(s)

"@fluentui-react-native/stack": "^0.8.11", "@fluentui/react-native": "^0.37.24",

OS version(s)

No response

Platform

  • iOS
  • macOS
  • win32
  • windows
  • android

Xcode version

14.2

Please provide a reproduction of the bug

function App(): JSX.Element {
  return (
    <SafeAreaView>
      <Stack gap={20} horizontal>
        <Stack.Item>
          <View style={{width: 20, height: 20, backgroundColor: 'blue'}} />
        </Stack.Item>
        <Stack.Item>
          <View style={{width: 20, height: 20, backgroundColor: 'red'}} />
        </Stack.Item>
        <Stack.Item>
          <View style={{width: 20, height: 20, backgroundColor: 'green'}} />
        </Stack.Item>
      </Stack>
      <Stack gap={20} horizontal>
        <Text>A</Text>
        <Text>B</Text>
        <Text>C</Text>
      </Stack>
    </SafeAreaView>
  );
}

Actual behavior

Stack elements render vertically with incorrect gapping:
Screen Shot 2023-09-11 at 10 27 25 AM

Expected behavior

Stack elements render horizontally

@thesharifi
Copy link

@Saadnajmi, I am interested in contributing to this Repo, please assign this issue to me.

@Saadnajmi
Copy link
Collaborator

@Saadnajmi, I am interested in contributing to this Repo, please assign this issue to me.

That's great! However, with the release of React Native and the new Flexbox gap style prop, Stack is actually no longer necessary, and can probably be deprecated 😅

@TomSwift
Copy link
Author

TomSwift commented Sep 29, 2023

Stack was never strictly "necessary". But you'll still need a container to apply your Flexbox gap style to, and I don't see why you wouldn't do that via Stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants