variant-classnames icon indicating copy to clipboard operation
variant-classnames copied to clipboard

$notnil selector doesn't work

Open borispoehland opened this issue 2 years ago • 0 comments

Hey,

The $notnil selector doesn't work, and I know why. In your code you have:

// when prop has no value, we pretent value is $nil to be able to kick off $nil hook later.
  if (isNil(correspondingSourceValue)) {
    correspondingSourceValue = $nil;
  }
  // ...
  if (!isNil(valueVariations[$notnil]) && !isNil(correspondingSourceValue)) {
    matchingVariations = [valueVariations[$notnil], matchingVariations].filter(Boolean).join(" ");
  }

Because you set correspondingSourceValue to $nil, the check !isNil(correspondingSourceValue) does not become true. Instead, you can check with !isNil(source[prop])

borispoehland avatar Dec 09 '22 18:12 borispoehland