S
SolidJS4mo ago
Grahf

onChange only fires when press enter ?!

const handleChannelSearch = (term) => {
console.log('term: ', term)
}

<input
type='text'
placeholder='Search For A Channel'
class='input input-bordered w-full'
onChange={(event) => handleChannelSearch(event.target.value)}
/>
const handleChannelSearch = (term) => {
console.log('term: ', term)
}

<input
type='text'
placeholder='Search For A Channel'
class='input input-bordered w-full'
onChange={(event) => handleChannelSearch(event.target.value)}
/>
5 Replies
Grahf
GrahfOP4mo ago
Not sure why the console log doesnt fire when I type in the input
brenelz
brenelz4mo ago
Try using onInput I think the React onChange is different from Solids
jer3m01
jer3m014mo ago
yep same as native onchange event, react has a custom behavior
Grahf
GrahfOP4mo ago
You da man. Maybe I've always used onInput in the past and just thought onChange was the right thing to do because my brain burst. Didn't think about that at all. thank you
Alex Lohr
Alex Lohr4mo ago
Actually, react switches the original DOM events and thus causes a lot of confusion.
Want results from more Discord servers?
Add your server