Skip to content

#1067: Overwrite MoM classnames instead of adding to the list#1069

Merged
tunetheweb merged 3 commits intomainfrom
1067-mom-rendering
Jun 9, 2025
Merged

#1067: Overwrite MoM classnames instead of adding to the list#1069
tunetheweb merged 3 commits intomainfrom
1067-mom-rendering

Conversation

@sarahfossheim
Copy link
Copy Markdown
Collaborator

Issue

Styling was being added to the month over month components by adding to the classList:

changeSlot.classList.add(styling.color, styling.direction)

or:

changeSlot.classList.add('monthchange', styling.color, styling.direction)

As a result, the icons were added twice when switching between mobile and desktop (which doesn't reload the page or clear out the existing components).

Fix

Instead of adding to the classList, the className now gets overwritten:

changeSlot.className = `month change ${styling.color} ${styling.direction}`.

}

if(latestChange && latestChange.string && latestChange.perc) {
if(latestChange && latestChange.string && latestChange.perc != null) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you broke this in #1068 as 0's weren't showing so fixed it here.

@tunetheweb tunetheweb merged commit f7dac24 into main Jun 9, 2025
7 of 8 checks passed
@tunetheweb tunetheweb deleted the 1067-mom-rendering branch June 9, 2025 10:36
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.

2 participants