Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vwc-button-toggle-group] race condition between values property and child buttons in the main slot #1321

Closed
k-paxian opened this issue Jun 22, 2022 · 1 comment · Fixed by #1324
Assignees
Labels
Type: Bug 🐞 Something isn't working

Comments

@k-paxian
Copy link
Collaborator

k-paxian commented Jun 22, 2022

Describe the bug

There is a bit cumbersome logic buried here and here
and this line is not allowing setting an empty array as a value w/o immediate npe 😄
and this logic needs to be re written in order to support races between properties and children's

To Reproduce

  1. Set values property to some meaningful state like ['foo']
  2. render the element with two buttons
    <vwc-button-toggle-group required .values=['foo']>
      <vwc-button value='foo'>Foo</vwc-button>
      <vwc-button value='bar'>Bar</vwc-button>
    </vwc-button-toggle-group>
  1. when setting altogether values & childrens it's not always works as expected

Expected behavior

values property should allow idempotent usage, no matter when and how many times this property is set, the state should be consistent and independent from absence and/or presence of child buttons, since element is actually allows children mutations in runtime 😃 cite from here: One can add more buttons dynamically

Additional context
originated from this issue

@k-paxian k-paxian changed the title [vwc-button-toggle-group] [vwc-button-toggle-group] race condition between values property and child buttons in the main slot Jun 22, 2022
@k-paxian k-paxian added the Type: Bug 🐞 Something isn't working label Jun 22, 2022
@yinonov
Copy link
Contributor

yinonov commented Jun 22, 2022

Thanks for the deep analysis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
Status: Done
3 participants