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.

Closing Dialog with transition blocks page interaction

See original GitHub issue

Using 1.0.0-beta.21. I have something like this:

        <Dialog
          fullScreen
          open={this.addProductDialogOpen}
          transition={props => <Slide direction="up" {...props} />}
          onRequestClose={this.handleAddProductClose}
        >
          <AppBar className={classes.appBar}>
            <Toolbar>
              <IconButton
                color="contrast"
                disableRipple
                onClick={this.handleAddProductClose}
              >
                <CloseIcon />
              </IconButton>
              <Typography type="title" color="inherit" className={classes.flex}>
                Select product
              </Typography>
            </Toolbar>
          </AppBar>
          <DialogContent>
            <Autocomplete
              getOptions={() => options()}
              onSuggestionSelected={this.handleAddProduct}
            />
          </DialogContent>
        </Dialog>

When closing the dialog the <div data-mui-portal="true"> remains and, although the contents are not visible, it blocks any interaction with the page. If I remove transition={props => <Slide direction="up" {...props} />} the div is removed on close.

I see the same behaviour (div remains attached) with the docs demo but there there’s no obstruction.

Anything I can do do provide more info ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

14reactions
oliviertassinaricommented, Dec 7, 2017

Duplicate of #8919

Move the transition component definition outside of the rendering method.

2reactions
oliviertassinaricommented, Dec 11, 2017

@the-noob I’m happy to hear it’s fixing your issue. I hope this case was better handled.

Any Amazon wishlist items or similar ? Great effort with this lib (unlike other people I won’t name)!

Thank you! You can always support me or the community, an announcement is coming #9460 🎄 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Closing Dialog with transition blocks page interaction #9290
When closing the dialog the <div data-mui-portal="true"> remains and, although the contents are not visible, it blocks any interaction with the ...
Read more >
Building a dialog component - web.dev
The dialog element comes with a close event: it emits immediately when the dialog close() function is called. Since we're animating this element ......
Read more >
Best way to block closing Dialog by clicking away? - Twine Q&A
The main thing to focus on is the 'if/else' block in the first (JavaScript) code section. It toggles the user's ability to dismiss...
Read more >
Don't close Dialog(Modal) when click outside in React ...
I'm using HeadlessUI's Dialog component for React in my app and when I click out of modal I wish it wouldn't close. In...
Read more >
Dialogs - Material Design
A simple dialog allows the following interactions: Tap an action to choose it and close the dialog; Tap outside the dialog to close...
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