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

[Autocomplete][joy] Fix Autocomplete and Modal components to work together #37515

Conversation

saikathalderr
Copy link
Contributor

@saikathalderr saikathalderr commented Jun 6, 2023

Fixed In Joy UI Autocomplete and Modal do not work properly together.

closes #37501

After:

Screen.Recording.2566-06-22.at.10.59.41.mov

https://codesandbox.io/s/joy-cra-ts-forked-kcds54?file=/src/App.tsx

@mui-bot
Copy link

mui-bot commented Jun 6, 2023

Netlify deploy preview

https://deploy-preview-37515--material-ui.netlify.app/

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against eeef6ec

@saikathalderr saikathalderr marked this pull request as draft June 6, 2023 09:34
@saikathalderr saikathalderr marked this pull request as ready for review June 6, 2023 09:41
@zannager zannager added component: autocomplete This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy labels Jun 6, 2023
@zannager zannager requested a review from siriwatknp June 6, 2023 12:38
@danilo-leal danilo-leal changed the title [Autocomplete] Fixed In joyUI Autocomplete and Model does not work properly together [Autocomplete] Fix Autocomplete and Modal components to work together Jun 6, 2023
@danilo-leal danilo-leal changed the title [Autocomplete] Fix Autocomplete and Modal components to work together [Autocomplete][joy] Fix Autocomplete and Modal components to work together Jun 6, 2023
@mnajdova
Copy link
Member

@siriwatknp can you please check this.

@siriwatknp
Copy link
Member

@saikathalderr Thanks for the fix. I think it is partially done because by adding zIndex might work with Modal but it introduces another bug when you use the Autocomplete outside of the Modal.

For example, you have a header with a sticky position (zIndex < the modal) if you scroll the page while Autocomplete's listbox is open, you will see that the listbox is above the header.

I think the solution is still using zIndex but with a CSS variable so that it can be controlled by the context (components).

@@ -500,7 +501,6 @@ const Select = React.forwardRef(function Select<TValue extends {}>(
additionalProps: {
ref: listboxRef,
anchorEl,
disablePortal: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall why disablePortal is used here but I think it should not have it true by default to be consistent with other popup.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for initiating the fix!

@siriwatknp siriwatknp merged commit 283b1aa into mui:master Jun 29, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In joy UI Autocomplete and Model does not work properly together
5 participants