Skip to content

Comments

fix: remove mask image if the forecast container is not scrollable#50

Merged
troinine merged 1 commit intomainfrom
fix/improved-scroll-container-handling-of-non-scrollable-content
Jan 1, 2026
Merged

fix: remove mask image if the forecast container is not scrollable#50
troinine merged 1 commit intomainfrom
fix/improved-scroll-container-handling-of-non-scrollable-content

Conversation

@troinine
Copy link
Owner

@troinine troinine commented Jan 1, 2026

No description provided.

@troinine troinine requested a review from Copilot January 1, 2026 11:15
@troinine troinine added the fix Fix or improvement label Jan 1, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where the fade mask (gradient overlay) was always applied to the forecast container, even when the content wasn't scrollable. The fix adds logic to detect when the forecast container is scrollable and conditionally applies the mask CSS only in those cases.

Key changes:

  • Added scrollability detection logic that compares the number of forecast items to the calculated items that fit in the viewport
  • Conditionally applied the is-scrollable CSS class using Lit's classMap directive
  • Restructured CSS to only apply mask styles when the container is scrollable

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/weather-forecast-card.ts Added _isScrollable state property, imported classMap directive, implemented logic to detect scrollable state in layoutForecastItems, and conditionally applied the is-scrollable class to the forecast container
src/weather-forecast-card.css Moved mask-related CSS properties into a new .wfc-forecast-container.is-scrollable selector, keeping pointer-events: auto on the base container class
test/weather-forecast-card.test.ts Added comprehensive test to verify the is-scrollable class and _isScrollable property are correctly toggled based on whether content overflows the container

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@troinine troinine merged commit fa5d042 into main Jan 1, 2026
9 checks passed
@troinine troinine deleted the fix/improved-scroll-container-handling-of-non-scrollable-content branch January 1, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant