Material-ui: Max call stack - Modal._this.enforceFocus

Created on 19 Feb 2018  路  6Comments  路  Source: mui-org/material-ui

image
image

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Doesn't exceed the call stack

Current Behavior

Maximum call stack size exceeded

Steps to Reproduce (for bugs)

I can't fully reproduce this issue, as it seems it's an edge case - but this was the environment in which it occurred

  1. Add a component to the page which keeps itself in focus (monaco editor in this case)
  2. Open up a new modal
  3. Max call stack exceeded

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | beta.34 |
| React | 16.2.0 |

Modal question

Most helpful comment

disableEnforceFocus inside Dialog solved this issue for me.

All 6 comments

Add a component to the page which keeps itself in focus

@samdenty99 The modal also keeps itself in focus. The maximum call stack error is the expected behavior. You have an infinite focus loop.
Ideally, the modal component should be able to detect the loop and raised an extra warning along suggesting people to diable the behavior with disableEnforceFocus.

Given it's the first time the problem is raised. Let's use this issue as documentation for future people facing it.

I got this error when using a Popover inside my Dialog with focus on an Input, i found this issue by google and solved it by adding disableEnforceFocus when the input was focused and the Popover is visible, I think this issue is enough 馃憤

Got the same problem as @albinekb with a Popover (Select) inside a Modal. Why is this error normal behavior?

I get this error when I open Dialog from Menu-component. If I open my Dialog by clicking Button I don't get the error.

Also facing the issue when opening dialog from menu

disableEnforceFocus inside Dialog solved this issue for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anthony-dandrea picture anthony-dandrea  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments

finaiized picture finaiized  路  3Comments

ghost picture ghost  路  3Comments

reflog picture reflog  路  3Comments