Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Blocks SDK Request: Add onFocus & onBlur handler to Input component

Topic Labels: Custom Extensions
317 0
cancel
Showing results for 
Search instead for 
Did you mean: 

The Input component is missing onFocus & onBlur handlers, which are pretty useful for e.g. form validation. At the moment the only way around it it is to use refs which gets pretty messy.
Current doing this:

...
useEffect(() => {
    if (inputRef && inputRef.current) {
      inputRef.current.onblur = console.log;
    }
  }, [inputRef]);

return (
       <Input
       ref={inputRef}
       value={value}
       onChange={handleChange}
/>
)

When I’d love to do this:

return (
       <Input
       onBlur={console.log}
       value={value}
       onChange={handleChange}
/>
0 Replies 0