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

zIndex on toast with Dialog not working #2080

Closed
imdkbj opened this issue Jun 3, 2021 · 7 comments
Closed

zIndex on toast with Dialog not working #2080

imdkbj opened this issue Jun 3, 2021 · 7 comments

Comments

@imdkbj
Copy link

imdkbj commented Jun 3, 2021

Hey,

I have set the following props to the toast and toast is still showing in background when dialog is active.

<Toast ref={(el) => this.toast = el} position="top-right" style={{ zIndex: 10002, marginTop: 100 }} />

image

Is something wrong there!!

@mertsincan
Copy link
Member

mertsincan commented Jun 4, 2021

Hi,

The zIndex properties of Toast and Modals are the same. Please check; #1924

I think you can use baseZIndex property for this issue.

Exp;

<Toast baseZIndex={2000} .../>

Best Regards,

@mertsincan mertsincan reopened this Jun 4, 2021
@imdkbj
Copy link
Author

imdkbj commented Jun 5, 2021

Still same issue.

@mertsincan
Copy link
Member

Hi @imdkbj,

Thanks a lot for the update! I added 'toast' key to ZIndex option and autoZIndex option to PrimeReact api. Please see these issues:
#1924
#2088

If PrimeReact.autoZIndex is false, you can manually set the zIndex values ​​of the groups for your app. After 6.4.0 is released, Please try;

import PrimeReact from 'primereact/api';

PrimeReact.autoZIndex = false;
PrimeReact.zIndex = {
    modal: 1100,
    overlay: 1000,
    menu: 1000,
    tooltip: 1100,
    toast: 2000
};

Best Regards,

@imdkbj
Copy link
Author

imdkbj commented Jun 18, 2021

Hi,

Even with the new update, it's not working at my side, well toast zindex in greater than the dialog (Default).
Pls help.

image

@VsevolodGolovanov
Copy link

@bloodykheeng
Copy link

@mertsincan your solution doesnt work at all import PrimeReact from 'primereact/api';

PrimeReact.autoZIndex = false;
PrimeReact.zIndex = {
modal: 1100,
overlay: 1000,
menu: 1000,
tooltip: 1100,
toast: 2000
};

@bloodykheeng
Copy link

@mertsincan @imdkbj This is the correct way of setting it

learn from here for more info
https://primereact.org/configuration/

import { PrimeReactProvider } from "primereact/api";

function App() {
    const primeReactConfig = {
        zIndex: {
            modal: 1500,    // Default: 1100
            overlay: 1400,  // Default: 1000
            menu: 1300,     // Default: 1000
            tooltip: 1600,  // Default: 1100
            toast: 1700     // Default: 1200
        }
    };

    return (
        <PrimeReactProvider value={primeReactConfig}>
            <div className="App">
                {/* Your application components go here */}
            </div>
        </PrimeReactProvider>
    );
}

export default App;

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

4 participants