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.

autocompleteinput renders suggestioncontainer behind dialog

See original GitHub issue

What you were expecting: To see the suggestion container

What happened instead: I see the suggestion container behind the dialog

Steps to reproduce:

               <Dialog
                    open={this.state.open}
                    onClose={this.handleClose}
                    aria-labelledby="form-dialog-title"
                >
                    <DialogTitle id="form-dialog-title">Kopieer configuratie</DialogTitle>
                    <DialogContent>
                    <ReferenceInput label="Project" resource="projecten" source="lotSelectionProjectId" reference="projecten" filterToQuery={searchText => ({ naam: searchText })}>
                        <AutocompleteInput optionText="naam" optionValue="id" inputValueMatcher={() => null} />
                    </ReferenceInput>
                    </DialogContent>
                    <DialogActions>
                        <Button onClick={this.handleClose} color="primary">
                            Cancel
                        </Button>
                        <Button onClick={this.handleClose} color="primary">
                            Kopieer
                        </Button>
                    </DialogActions>
                </Dialog>

Other information: SelectInput renders correct

Environment

  • React-admin version: 2.4.0
  • React version: 16.5.2
  • Browser: chrome

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
meastpcommented, Jul 16, 2020

This is still broken in 3.7.0 - I can press the down arrow and Return when I know there is a match, but the suggestions are never visible (I’m using a dialog).

2reactions
sgonzaloccommented, May 13, 2020

Well I share a solution for react-admin version 2.8.5. I think that this will help to fix this issue quickly without searching more examples around the web

Here the styles that you need to add, usually with withStyles. You can use another zIndex value but should be bigger than the dialog zIndex value. The default value of this component was 2.

const styles = {
  suggestionsContainerOpen: {
    zIndex: 2100,
  },
};

Using withStyles to add the styles

withStyles(styles)(yourCustomClassName)

And here in the render function, I give you an example about how you should do to override the className

<AutocompleteArrayInput
  classes={{
    suggestionsContainerOpen: classes.suggestionsContainerOpen,
  }}
  choices={choicesList}
/>

@TomJannes Could you please write your solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Input Components - React-admin - Marmelab
To let users choose a value in a list using a dropdown with autocompletion, use <AutocompleteInput> . It renders using downshift and a...
Read more >
Google Maps Autocomplete Result in Bootstrap Modal Dialog
I have a Google Maps Autocomplete input field inside a Twitter Bootstrap modal dialog and the autocomplete result is not displayed.
Read more >
autocomplete drop down renders behind jqgird form
Hi there, I have problems with autocomplete when the grid is over a dialog. The solution posted here (jqGrid Forum) doesn't work in...
Read more >
places.Autocomplete hides behind JQuery Dialog
I have a JQuery modal dialog that has a google places map object along with an autocomplete input text field. First off, 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