Skip to content

Follow up: Fix SegmentButton and SelectButton loading spinner colors #1200

@georgewrmarshall

Description

@georgewrmarshall

Overview

Follow-up from #1172. SegmentButton and SelectButton can pass an empty string into ButtonBase's loading spinner color path.

Problem

ButtonBase derives the loading spinner color from textClassName(pressed) when textClassName is provided:

color={
  textClassName
    ? (textClassName(pressed) as IconColor)
    : IconColor.IconDefault
}

The new components sometimes return '' from textClassName / iconClassName:

  • SegmentButton: unselected states return ''
  • SelectButton: tertiary variant returns ''

Because '' is still passed as an explicit color prop, it bypasses Spinner's IconColor.IconDefault default and leaves the loading icon without a valid design-system color class.

Acceptance Criteria

  • Loading spinner color is valid for every SegmentButton variant/selected combination.
  • Loading spinner color is valid for every SelectButton variant.
  • Tests cover the loading spinner color for the affected unselected/tertiary states.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions