Closed torra closed 2 months ago
Ah whoops. Good catch. The Input
, Select
, and Textarea
components use the event in their onChange
handler rather than just the value so it's the docs that are incorrect here. I've corrected the examples in the docs.
Thanks for pointing this out! ✨
Thanks! Appreciate the quick turnaround.
What component (if applicable) Catalyst Input component
Describe the bug When using the Catalyst component, if I copy the the example from the documentation, the rendered input component does not correctly update with the value the user types. Instead, it updates with
[Object object]
, as it is casting a javascript Event object to a string.To Reproduce Steps to reproduce the behavior:
[object Object]
rather than the string value you enteredonChange
handler to a function for debugging, like:handleChange
function, and note that the value passed into the event handler is an Event object, not the string value as expected based on the documentation.Expected behavior As the documentation shows, the expected behavior would be for the event handler to be passed the string value of
event.target.value
.Screenshots Visual example of the problem:
Browser/Device (if applicable)
Additional context I also have the same problem with the Textarea component (https://catalyst.tailwindui.com/docs/textarea#controlled-component), but other components, like Listbox and Switch, seem to work as expected from the docs.