-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SearchBox autoFocus causes an Uncaught TypeError in office-ui-fabric-react (6.76.0) #6562
Comments
Inputs (and our SearchBox) do not support an autofocus prop That property seems to only be used on selects https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autofocus |
@micahgodbolt inputs do support an autofocus attribute I believe: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Global_%3Cinput%3E_attributes (search for autofocus under attributes) In JSX though it is autoFocus (note the capital F). https://stackoverflow.com/a/28891210 I would like to investigate this issue if it is worth investigating. |
If autoFocus is set, _onFocusCapture is called before the ref is set on the root div. facebook/react#7769 is a relevant issue, and I have this workaround working on my branch (using |
Doh :D autoFocus is part of the interface...carry on! |
@micahgodbolt @gregdardis Thank you both for the support on this :) |
🎉This issue was addressed in #6566, which has now been successfully released as Handy Links: |
Please provide a reproduction of the bug in a codepen:
https://codepen.io/avenezia/pen/RerEox
Bug Report
Priorities and help requested:
Are you willing to submit a PR to fix? No
Requested priority: Normal
Products/sites affected: Power Query Online
Describe the issue:
While migrating our product to the latest version of office-ui-fabric-react (6.76.0), I noticed a bug with the autoFocus of the SearchBox: if set to true, it will cause a "Uncaught TypeError: Cannot read property 'events' of null".
Actual behavior:
"Uncaught TypeError: Cannot read property 'events' of null" is thrown when the autoFocus of the SearchBox is set to true: the full stack trace can be found in the codepen
Expected behavior:
No Uncaught TypeError to be thrown
The text was updated successfully, but these errors were encountered: