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

AccordionBox is handling margins inconsistently #892

Open
marlitas opened this issue Sep 6, 2024 · 0 comments
Open

AccordionBox is handling margins inconsistently #892

marlitas opened this issue Sep 6, 2024 · 0 comments
Assignees
Labels

Comments

@marlitas
Copy link
Contributor

marlitas commented Sep 6, 2024

While working on layout for NumberPairs I noticed that the contentXMargin wasn't being applied as expected. It appeared to be splitting the margin in half since the margin was not being multiplied by 2 in the minimum width calculation when showTitleWhenExpanded is set to false.

I further noticed that titleXMargin is being multiplied by 2 in all scenarios.

Understandably contentYMargin is only being multiplied when showTitleWhenExpanded is false. I assume this is because we do not want to apply a margin between the title and the content, we only want to apply contentYSpacing.

Overall, it seems like contentXMargin is not being applied consistently or as expected. Since this affects a large number of sims I would like to discuss with @jonathanolson before moving forward.

    // content is next to button
    else {
      minimumBoxWidth = Math.max( minimumBoxWidth, this.expandCollapseButton.width + minimumContentWidth + options.buttonXMargin + options.contentXMargin + options.contentXSpacing );
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants