`Dialog` should have an `initialFocus` prop listed in the docs to be passed onto `FocusContainer`
See original GitHub issueDescription
I came across this when closing one dialog and after an async action triggered with onHide. After the async action returns successfully, I display a second dialog confirming success.
On displaying the second dialog, a warning Uncaught Error: You specified that the
FocusContainershould focus an element on mount, but a focusable element was not found in the children. This could be because the
initialFocus prop is an invalid id or query selector, or the children do not contain a valid focusable element.undefined
is displayed.
I fixed this by passing an initialFocus
prop with an id to Dialog
and it works fine, but this seems to be undocumented in the docs.
Version
- React 15.4.2
- React-MD 1.0.6
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Gtk.Window · Python GTK+ 3 API
A Gtk.Window is a toplevel window which can contain other widgets. Windows normally have decorations that are under the control of the windowing...
Read more >GtkWindow: GTK+ 3 Reference Manual - manpagez
It also supports the <initial-focus> element, whose name property names the widget to receive the focus when the window is mapped.
Read more >Gtk.Window - GTK Documentation
A GtkWindow is a toplevel window which can contain other widgets. Windows normally have decorations that are under the control of the windowing...
Read more >Gtk.Window – gtk+-3.0 - Valadoc
It also supports the `<initial-focus>` element, whose name property names the widget to receive the ... Whether the window frame should have a...
Read more >gtk.Window
Windows normally have decorations that are under the control of the ... It also supports the <initial-focus> element, whose name property names the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can update your dialog to have
focusOnMount={false}
and it won’t do any of the focusing logic.It’s also unnecessary. I have a dialog that doesn’t have any inputs, only text. Ideally, I shouldn’t need to have to use initialFocus at all. Can we fix this?