conversionxl / aybolit

Lightweight web components library built with LitElement.
https://conversionxl.github.io/aybolit/
MIT License
7 stars 8 forks source link

feat(cxl-ui): [cxl-vaadin-accordion] add simple attribute to disable state restoration #273

Closed anoblet closed 1 year ago

anoblet commented 1 year ago

https://app.clickup.com/t/861mma51g

Adding the simple attribute disables state restoration:

<cxl-vaadin-accordion simple></cxl-vaadin-accordion>
github-actions[bot] commented 1 year ago

size-limit report 📦

Path Size
packages/cxl-ui/pkg/dist-web/cxl-ui.js 33.81 KB (+0.74% 🔺)
packages/cxl-ui/pkg/dist-web/cxl-ui-jwplayer.js 11.87 KB (0%)
packages/cxl-ui/pkg/dist-web/cxl-ui-playbooks.js 24.9 KB (0%)
packages/cxl-ui/pkg/dist-web/vendor.js 125.6 KB (0%)
packages/cxl-ui/pkg/dist-web/cxl-ui-jwplayer.js, packages/cxl-ui/pkg/dist-web/cxl-ui-playbooks.js, packages/cxl-ui/pkg/dist-web/cxl-ui.js, packages/cxl-ui/pkg/dist-web/manifest.js, packages/cxl-ui/pkg/dist-web/unresolved.js, packages/cxl-ui/pkg/dist-web/vendor.js 197.34 KB (+0.13% 🔺)
lkraav commented 1 year ago

Adding the simple attribute disables state restoration:

I'm unclear on what exactly this tries to achieve, even after reading through CU link.

Can you make an explicit goal statement here?

To avoid any open cards at all page loads, just use <vaadin-accordion opened="-1">, done.

anoblet commented 1 year ago

To avoid any open cards at all page loads, just use <vaadin-accordion opened="-1">

I tried this first, though it didn't work. I just tried it again in incognito mode, and it works. I'm not sure how concerned we are that if a user has already opened a panel, state will take precedence over opened="-1".

lkraav commented 1 year ago

I tried this first, though it didn't work. I just tried it again in incognito mode, and it works. I'm not sure how concerned we are that if a user has already opened a panel, state will take precedence over opened="-1".

State persistence is a feature of <cxl-vaadin-accordion>, not upstream original element.

anoblet commented 1 year ago

State persistence is a feature of , not upstream original element.

Are you suggesting using vaadin-accordion and styling it accordingly?

The use case is simple: Close all panels by default.

lkraav commented 1 year ago

State persistence is a feature of , not upstream original element.

Are you suggesting using vaadin-accordion and styling it accordingly?

https://github.com/conversionxl/aybolit/pull/273#issuecomment-1502104334

The use case is simple: Close all panels by default.

«Open multiple panels?» is the other key requirement to identify.

anoblet commented 1 year ago

«Open multiple panels?» is the other key requirement to identify.

You're right. Ideally we would refactor this to use vaadin-details, though for the short-term: <cxl-vaadin-accordion opened="-1"></cxl-vaadin-accordion> should work.

I've added a comment to the Clickup task(https://app.clickup.com/t/861mma51g?comment=90060010022860) to see what the rest of the team thinks

anoblet commented 1 year ago

https://github.com/conversionxl/aybolit/pull/273#issuecomment-1502104334

<cxl-vaadin-accordion opened="-1"></cxl-vaadin-accordion>