[Bug]: DatePicker Compat focus on first render
Library
React Components / v9 (@fluentui/react-components)
System Info
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz
Memory: 3.89 GB / 15.67 GB
Browsers:
Chrome: 114.0.5735.91
Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.37)
Internet Explorer: 11.0.19041.1566
Are you reporting Accessibility issue?
no
Reproduction
https://codesandbox.io/s/muqpdf?file=/example.tsx
Bug Description
Actual Behavior
The component is focused on initial render. This is not good, since if an app has multiple components, the date picker will be focused when the app is rendered.
Expected Behavior
The component should not focus on initial render. You will need to detect the first time useEffect runs and make sure you do not call focus() on that first run.
Logs
No response
Requested priority
High
Products/sites affected
@fluentui/react-datepicker-compat
Are you willing to submit a PR to fix?
yes
Validations
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] The provided reproduction is a minimal reproducible example of the bug.
:tada:This issue was addressed in #28188, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links:
:tada:This issue was addressed in #28188, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links: