react-spectrum
react-spectrum copied to clipboard
DatePicker focus and blur events are not being triggered
๐ Bug Report
Tried to invoke a few event based functions except for onChange the rest are not being invoked.
For example the on focus and blur functions: let elemAttrs = { onFocusChange:(e) => this.onFocusChange(e), onFocus:(e) => this.onFocus(e), onBlur:(e) => this.onBlur(e) };
๐ค Expected Behavior
Focus and blur related event handlers should be triggered
๐ฏ Current Behavior
onBlur, onFocus, onFocusChange are not being triggered correctly
๐ Possible Solution
๐ฆ Context
๐ป Code Sample
const onFocusChange =() => { console.log("onFocusChange called"); }
const onFocus =() => { console.log("onFocus called"); }
const onBlur =() => { console.log("onBlur called"); }
let elemAttrs = { ...., onFocusChange:(e) => this.onFocusChange(e), onFocus:(e) => this.onFocus(e), onBlur:(e) => this.onBlur(e) };
<DatePicker {...elemAttrs} />
๐ Your Environment
Software | Version(s) |
---|---|
react-spectrum | 3.19.0 |
Browser | Chrome |
Operating System | MacOS |
๐งข Your Company/Team
๐ท Tracking Issue (optional)
reproduced here: https://codesandbox.io/s/elegant-dew-0xitgj?file=/src/App.js
I am also facing same problem of onBlur
not getting invoked. Any ETA on fix?
We are facing the same problem using the useTimeField
hook. onBlur
is not being called.
@joshuajaco thanks for the info. The draft pr linked to should fix this for the react-aria date hooks and the React Spectrum date components.