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

Ellipsis in combination with button icons breaks #78

Closed
Kashargul opened this issue Jan 29, 2025 · 0 comments
Closed

Ellipsis in combination with button icons breaks #78

Kashargul opened this issue Jan 29, 2025 · 0 comments

Comments

@Kashargul
Copy link
Contributor

Kashargul commented Jan 29, 2025

<Stack align="center">
  <Stack.Item basis="70%">
    <Button
      fluid
      icon="shopping-cart"
      ellipsis
      color={pack.cost > supply_points ? 'red' : undefined}
      onClick={() => act('request_crate', { ref: pack.ref })}
    >
      {pack.name}
    </Button>
  </Stack.Item>
  <Stack.Item>
    <Button
      color={pack.cost > supply_points ? 'red' : undefined}
      onClick={() =>
        act('request_crate_multi', { ref: pack.ref })
      }
    >
      #
    </Button>
  </Stack.Item>
  <Stack.Item>
    <Button
      color={pack.cost > supply_points ? 'red' : undefined}
      onClick={() => act('view_crate', { crate: pack.ref })}
    >
      Info
    </Button>
  </Stack.Item>
  <Stack.Item grow>{pack.cost} points</Stack.Item>
</Stack>

Image

Current workaround, use the icon as it's own stack element. The props maybe should be exclusive if there's no way to avoid the issue.

Workaround:

<Stack.Item maxWidth="70%" basis="70%">
  <Button
    fluid
    color={pack.cost > supply_points ? 'red' : undefined}
    onClick={() => act('request_crate', { ref: pack.ref })}
  >
    <Stack fill>
      <Stack.Item>
        <Icon name="shopping-cart" />
      </Stack.Item>
      <Stack.Item
        grow
        style={{
          overflow: 'hidden',
          textOverflow: 'ellipsis',
          display: 'block',
        }}
      >
        {pack.name}
      </Stack.Item>
    </Stack>
  </Button>
</Stack.Item>
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

1 participant