Skip to content

fix(button): dont render double icons on icon-only-button when loading#4023

Merged
Barsnes merged 7 commits intomainfrom
icon-buttons-loading
Oct 1, 2025
Merged

fix(button): dont render double icons on icon-only-button when loading#4023
Barsnes merged 7 commits intomainfrom
icon-buttons-loading

Conversation

@stianmorsund
Copy link
Collaborator

@stianmorsund stianmorsund commented Sep 9, 2025

Summary

image

Icon-only buttons appear visually cluttered when both the icon and loading spinner are set to true. To improve clarity, remove the icon when loading is true so only the spinner is displayed. This does not affect assistive technology, as icon-only buttons should always include an appropriate aria-label.

resolves #4041

Checks

@changeset-bot
Copy link

changeset-bot bot commented Sep 9, 2025

🦋 Changeset detected

Latest commit: bfe2170

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-css Patch
@digdir/designsystemet-theme Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Preview deployments for this pull request:

storybook - 12. Sep 2025 - 13:17

@stianmorsund stianmorsund marked this pull request as ready for review September 10, 2025 13:39
@oddvernes oddvernes linked an issue Sep 11, 2025 that may be closed by this pull request
@Barsnes
Copy link
Member

Barsnes commented Sep 11, 2025

Thanks for the PR. We will discuss the best solution to this internally, and comment a decision in the issue

Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@Barsnes Barsnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the jsdoc as well?
An example in Storybook would also be nice, the one we have does not have an icon button

Image

@Barsnes Barsnes merged commit 81fc117 into main Oct 1, 2025
15 checks passed
@Barsnes Barsnes deleted the icon-buttons-loading branch October 1, 2025 08:06
@github-actions github-actions bot mentioned this pull request Oct 1, 2025
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

Successfully merging this pull request may close these issues.

<Button icon loading> renders outside of button

3 participants