Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening dropdown repositions elements below which seems unexpected #131

Open
mikem2005 opened this issue Jul 12, 2024 · 0 comments
Open

Comments

@mikem2005
Copy link

I'm not sure if this is a chakra-ui-autocomplete, downshift, or documentation issue, but it seems that the listStyleProps must use absolute position and a positive zIndex otherwise the open menu will push down other page content or render behind which seems unexpected for an element which is supposed to appear over other content.

I was able to work around the issue by

<CUIAutoComplete
  ...
  listStyleProps={{
    position: "absolute",
    zIndex: 1
  }}
>

This issue can be seen by editing example at https://codesandbox.io/s/chakra-ui-autocomplete-example1-8uxbs and placing a <Box> below the <CUIAutoComplete> and opening the menu.

      <Box px={8} py={4}>
        <CUIAutoComplete
          ...
        />
        <Box>I'm below the box</Box> <<<<---- this element moves
      </Box>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant