toggle button disable based on state #205
-
Hey All, InvalidCharacterError: Failed to execute 'setAttribute' on 'Element': '0' is not a valid attribute name. here's a sandbox to show how the onClick function gets lost if you used disable = {} vs {...props} https://codesandbox.io/s/busy-albattani-lx1dn?file=/src/App.tsx |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey there, If you use |
Beta Was this translation helpful? Give feedback.
-
hey @rbureau85, because we don't have an exact timeframe for 6.1 yet (though it will be soon), you can use the 6.1rc to unblock you for now.
This rc should be completely stable. Once it's released you can go back to use @astrouxds/react. Let us know if you have any issues with that (release candidates are a new workflow we're working on) |
Beta Was this translation helpful? Give feedback.
Hey there,
If you use
undefined
rather thanfalse
when setting disabled state, that should fix the problem. Here's a code sandbox example https://codesandbox.io/s/peaceful-cartwright-jzzodBecause Stencil's react output target handles the boolean prop bindings like non-react components, it ends up reading
disabled='false'
rather than just omitting disabled altogether in the dom. We have a fix implemented already and it'll be released in the next version.Thanks for bringing this up!