vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.43k stars 763 forks source link

Regression: Empty boolean attributes are broken in @cds/angular@5.6.1 (and up) #6642

Closed thojo closed 2 years ago

thojo commented 2 years ago

Describe the bug

After updating Clarity from 5.5.1 to 5.6.2 empty boolean attributes are evaluated as falsy. This was once already fixed for 5.2.1 in #5932.

<cds-tag readonly>readonly tag</cds-tag>

How to reproduce

Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/clarity-dark-theme-v5-ljlano?file=package.json
  2. Click on "Readonly Tag" an see interaction behaviour like "Clickable Tag", which shouldn't be there.
  3. Downgrade @cds/angular to 5.6.0
  4. Click on "Readonly Tag". There is no interaction behaviour.

Expected behavior

Empty boolean attributes are interpreted as truthy/present like in version 5.6.0.

Versions

Clarity project:

Clarity version:

Framework:

Framework version: Angular 11 and 12

Additional notes

A workaround is to use property binding syntax:

<cds-tag [readonly]="true">readonly tag</cds-tag>
coryrylan commented 2 years ago

Thank you for the reproduction! We should be able to get a fix out for our next release.

github-actions[bot] commented 2 years ago

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.