question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Dialog` should have an `initialFocus` prop listed in the docs to be passed onto `FocusContainer`

See original GitHub issue

Description

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 theinitialFocus 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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
mlaursencommented, Sep 14, 2017

You can update your dialog to have focusOnMount={false} and it won’t do any of the focusing logic.

3reactions
luisrudgecommented, Sep 14, 2017

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found