Skip to content

Correctly throw error when un-selectable image card is marked as selected#1343

Open
brentswisher wants to merge 3 commits into
developfrom
fix/image-card-selectable-check
Open

Correctly throw error when un-selectable image card is marked as selected#1343
brentswisher wants to merge 3 commits into
developfrom
fix/image-card-selectable-check

Conversation

@brentswisher

Copy link
Copy Markdown
Contributor

This change: (check at least one)

  • Adds a new feature
  • Fixes a bug
  • Improves maintainability
  • Improves documentation
  • Is a release activity

Is this a breaking change? (check one)

  • Yes
  • No

Is the: (complete all)

  • Title of this pull request clear, concise, and indicative of the issue number it addresses, if any?
  • Test suite(s) passing?
  • Code coverage maximal?
  • Changeset added?

What does this change address?
Fixes #1331

How does this change work?
The image card has several variants which can be selected: (https://pharos.jstor.org/storybook/?path=/story/web-components_components-image-card--selectable)

This can be set programmatically by passing a selected attribute to the web component. The component has some logic that if selected was set on an image card but it was not one of the variants which allowed for selection, it should throw an error.

There was a bug in the logic, while the HTML attribute is selected, the Lit property that maps to it is _isSelected, and the code was checking the wrong thing. In addition, the logic was inverse so if it was working it would have thrown errors for selectable variants when they were selected 🙃 .

This fixes the logic so the error will be thrown as originally intended, and re-enables the test that exercises this logic.

@brentswisher brentswisher self-assigned this Jul 21, 2026
@brentswisher
brentswisher requested a review from a team as a code owner July 21, 2026 12:36
@brentswisher
brentswisher requested review from lizlove and removed request for a team July 21, 2026 12:36
@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d7f0f1e

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

This PR includes changesets to release 1 package
Name Type
@ithaka/pharos 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
Copy Markdown
Contributor

size-limit report 📦

Path Size
packages/pharos/lib/index.js 1.05 MB (-0.01% 🔽)

Comment thread .changeset/thirty-poems-cough.md Outdated
@brentswisher
brentswisher force-pushed the fix/image-card-selectable-check branch from 31178db to c6515ca Compare July 21, 2026 17:47
@brentswisher
brentswisher requested a review from lizlove July 21, 2026 20:49
@brentswisher
brentswisher force-pushed the fix/image-card-selectable-check branch from c6515ca to d7f0f1e Compare July 21, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No error is emitted when selected attribute set on a non-selectable variant of the image card

3 participants