Bug: Calcite switch input name
and value
attributes overwritten
#42
Labels
bug
Bug reports for broken functionality. Issues should include a reproduction of the bug.
cc @patrickarlt
I came across this while working on #1. I think this issue is coming from the
syncProxyInput
method. The method should check whether thethis.inputProxy
has aname
orvalue
before assigningthis.name
orthis.value
. It should also check whetherthis.name
orthis.value
isundefined
, to avoid assigning the string"undefined"
to the proxy input.To reproduce:
Pass an input with a name and/or value into
calcite-switch
's slot:Expected result
Expect to have
calcite-switch
's input element to have correct name and value attrs in the outputted DOM, e.g.Actual result
name
andvalue
are overwritten with the string"undefined"
.Note that this only happens with
name
andvalue
. You could pass insome-random-attr='test'
and it is maintained.Workaround
You can put the
name
andvalue
oncalcite-switch
directly:The text was updated successfully, but these errors were encountered: