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

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}
/>
1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.