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

Bug: Calcite Switch switched attr not working when proxy input passed in #43

Closed
vcolavin opened this issue Jun 5, 2019 · 4 comments
Closed
Assignees
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug.

Comments

@vcolavin
Copy link
Contributor

vcolavin commented Jun 5, 2019

To reproduce

<calcite-switch switched='true'>
  <input type='checkbox' />
</calcite-switch>

Expected result

Switch should be initially checked.

Actual result

Switch is initially unchecked

Workaround

You can put the checked attr on the input itself:

<calcite-switch>
  <input type='checkbox' checked/>
</calcite-switch>
@vcolavin vcolavin added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Jun 5, 2019
@vcolavin vcolavin self-assigned this Jun 5, 2019
@kumarGayu
Copy link
Contributor

I was thinking this is known issue. @patrickarlt did agree to document it I guess. because user wants to use child input only when they need to bind variables to native input so it is necessary to send. otherwise our source of truth is altered.

here is the link to review comment.
#33 (comment)

@vcolavin
Copy link
Contributor Author

vcolavin commented Jun 5, 2019

Good point, I hadn't considered that. From my perspective as a dev this is surprising and broken behavior, but from the point of view of not altering the source of truth, it is reasonable. We'll just have to be careful about documenting it.

@patrickarlt
Copy link
Contributor

@vcolavin Thanks for jumping on this. I think that in this scenario:

<calcite-switch switched='true'>
  <input type='checkbox' />
</calcite-switch>

since the user supplied the checkbox we should let values from the checkbox "win" so this should actually result in:

<!-- boolean props are if the attribute is present or not regardless of its value.-->
<calcite-switch>
  <input type='checkbox' />
</calcite-switch>

@vcolavin
Copy link
Contributor Author

vcolavin commented Jun 7, 2019

Seems like it's working as intended!

@vcolavin vcolavin closed this as completed Jun 7, 2019
julio8a pushed a commit that referenced this issue Dec 5, 2019
Still missing the border SASS vars from calcite-colors. Waiting for [#43](Esri/calcite-colors#43) to finishing adding the border SASS variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug.
Projects
None yet
Development

No branches or pull requests

3 participants