Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Button fill breaks on wide buttons #187

Closed
superhawk610 opened this issue Sep 1, 2018 · 3 comments
Closed

Button fill breaks on wide buttons #187

superhawk610 opened this issue Sep 1, 2018 · 3 comments
Assignees

Comments

@superhawk610
Copy link
Collaborator

Describe the bug
Button components with a long text string may not fill completely to the far right edge.

To Reproduce

  1. Change the text of the Delete button in DependencyManagementPane to a long string.
  2. Remove the fixed width style.
  3. Observe that the fill doesn't reach to the far right edge.

Expected behavior
Button fill should expand smoothly to fill entire width.

Screenshots
image

Environment (please complete the following information):

  • OS: Windows
  • Version: 62d3766
  • Node version: 10.7.0

Additional context
I was only able to reproduce this on DeleteDependencyButton.

@joshwcomeau
Copy link
Owner

This also appears to happen on really short buttons:

screen shot 2018-09-01 at 8 03 20 am

Thanks for taking this on, @prasoc! This one might be a bit tricky. The border is actually an SVG that calculates itself based on the children's size (I did it this way because it was the only way I could figure out to get a gradient in a border that looks good).

The code is in CircularOutline. If you could add a Storybook story for it, I think that'd be really helpful (and could also be useful in debugging), but it's not required :)

@superhawk610
Copy link
Collaborator Author

superhawk610 commented Sep 2, 2018

* Also, this component is oblivious to any parent resize-changes, so don't use
* it in a component that has the propensity to change sizes.

I didn't realize the border was a separate component or I would have checked, this note is taken from the doc comment for CircularOutline. Those two examples shown above are taken after changing the text from another string, I bet it has something to do with that.

Edit: Yeah, looks like you'll want some additional logic in componentDidUpdate to handle resizes.

j-blandford added a commit to j-blandford/guppy that referenced this issue Sep 2, 2018
joshwcomeau pushed a commit that referenced this issue Sep 14, 2018
* Fix for #187

* Dynamic sizing Storybook story

* Fixed Animations and tidied up Storybook for CircularOutline

* Improved Dynamic Button Width calculation
@joshwcomeau
Copy link
Owner

Closed by #201!

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

No branches or pull requests

3 participants