Skip to content

Commit

Permalink
fix: support false variants when using compoundSlots (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton authored Jul 25, 2023
1 parent e52f7dd commit 0fa67e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/tv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -842,14 +842,14 @@ describe("Tailwind Variants (TV) - Compound Slots", () => {
slots: ["item", "prev", "next"],
size: "xs",
color: "primary",
isBig: true,
isBig: false,
class: "w-7 h-7 text-xs",
},
],
defaultVariants: {
size: "xs",
color: "primary",
isBig: true,
isBig: false,
},
});
// with default values
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export const tv = (options, configProp) => {

// if none of the slot variant keys are included in props or default variants then skip the slot
// if the included slot variant key is not equal to the slot variant value then skip the slot
if (!completePropsValue || completePropsValue !== slotVariants[key]) {
if (completePropsValue === undefined || completePropsValue !== slotVariants[key]) {
return acc;
}
}
Expand Down

0 comments on commit 0fa67e3

Please # to comment.