@@ -8,7 +8,7 @@ const hasCustomId = settings => Object.hasOwnProperty.call(settings, 'id')
88
99const ToastManager = memo ( function ToastManager ( props ) {
1010 const { bindCloseAll, bindGetToasts, bindNotify, bindRemove } = props
11-
11+ const [ zindex , setZindex ] = useState ( 100 )
1212 const [ toasts , setToasts ] = useState ( [ ] )
1313 const [ idCounter , setIdCounter ] = useState ( 0 )
1414
@@ -63,11 +63,19 @@ const ToastManager = memo(function ToastManager(props) {
6363 hasCloseButton : settings . hasCloseButton ?? true ,
6464 duration : settings . duration || 5 ,
6565 close : ( ) => safeCloseToast ( id ) ,
66- intent : settings . intent
66+ intent : settings . intent ,
67+ zIndex : settings . zIndex
6768 }
6869 }
6970
7071 const notify = ( title , settings ) => {
72+ setZindex ( settings . zIndex )
73+ if ( settings . zIndex != undefined ) {
74+ setZindex ( settings . zIndex )
75+ } else {
76+ setZindex ( 100 )
77+ }
78+
7179 let tempToasts = toasts
7280 if ( hasCustomId ( settings ) ) {
7381 tempToasts = removeToast ( settings . id )
@@ -92,7 +100,7 @@ const ToastManager = memo(function ToastManager(props) {
92100 left = { 0 }
93101 right = { 0 }
94102 position = "fixed"
95- zIndex = { StackingOrder . TOASTER }
103+ zIndex = { zindex }
96104 pointerEvents = "none"
97105 >
98106 { toasts . map ( ( { description, id, ...rest } ) => {
0 commit comments