首页 > 解决方案 > 反应确认警报被引导模式阻止

问题描述

我在反应应用程序中使用引导模式。我需要在用户单击模式的保存按钮后要求他们确认。为了做到这一点,我使用了 react-confirm-alert 但对话框在模态后面继续打开。我检查了元素和 .modal-backdrop 类的 z-index 为 1040,而 react-confirm-alert-overlay 类的 z-index 为 99,我无法覆盖这两者。我使用 z-index 9999 创建了一个自定义类,并尝试在确认警报上添加此类(代码粘贴在下面),但该类从未应用于确认警报。任何人都可以帮助我处理这个 TIA。

.overlayClass {
    z-index: 9999 !important;
}

confirmAlert({
            title: 'Save Confirmation',
            message: 'There may be records with this configuration, saving this will update all those records. Are you sure you wish to update?',
            buttons: [
                {
                    label: 'Yes',
                    className: 'text',
                    onClick: () => {
                        this.handleSubmit();
                    }
                },
                {
                    label: 'No',

                }
            ],
            overlayClassName: "overlayClass"
        });

标签: reactjsbootstrap-modal

解决方案


推荐阅读