AlaskaAirlines / auro-accordion

Custom element that allows users to toggle the display for sections of content
https://auro.alaskaair.com/components/auro/accordion
Apache License 2.0
1 stars 1 forks source link

auro-accordion: Svelte cannot dynamically add/remove "expanded" attribute beyond version 1.3.1 #78

Closed gusnaughton closed 1 year ago

gusnaughton commented 1 year ago

Describe the bug

On our flight status page, we need to dynamically open auro-accordions for nonstop or multisegment flights. For instance, a nonstop flight will have an auro-accordion expanded (containing a tracker and waitlists):

image

On multisegment flights, however, we want all of those accordions collapsed:

image

www.alaskaair.com/status/day/today/65 is using auro-accordion v1.3.1. Updating to 1.6.6 makes this line impossible:

        <auro-accordion lowProfile noProfile justifyLeft  expanded={defaultCollapsed < 2 || undefined}>

In Svelte, nullish values assigned to attributes are excluded from inclusion on the DOM: https://svelte.dev/docs#template-syntax-attributes-and-props

To Reproduce

In a Svelte project, pull 1.6.6. In a component, use the above line to control whether the accordion expands by setting defaultCollapsed to 1 and 3.

Notice how no difference is made regardless of value, however the carat toggles successfully. It appears that the carat recognizes the value correctly, but the content in the accordion fold does not render.

Expected behavior

1.3.1 correctly allows content expansion, 1.6.6 does not.

blackfalcon commented 1 year ago

The recently released https://github.com/AlaskaAirlines/auro-accordion/commit/8ca2bbbc735d0dd2dec9b4bc38417fe6de14f27f updates may be the cause of the issues you are seeing.

@gusnaughton did you test all versions between 1.3.1 and 1.6.6 to validate that statement?

Patrick-Daly-AA commented 1 year ago

assigning back to Gus to re-test with the versions mentioned above.

blackfalcon commented 1 year ago

@gusnaughton have you been able to validate the questions regarding the large version gap? It would really help us to know what version to target so that we can address the issues you are seeing.

jason-capsule42 commented 1 year ago

Considering the rebuild of auro-accordion currently in the works should we just make sure this is not an issue there and not worry about fixing the current version?

blackfalcon commented 1 year ago

I am updating this to abandoned as we are not hearing back from @gusnaughton on this issue and we are rebuilding this component from scratch.

Will close in 30 days if there are no updates.