reactjs - 反应确认警报被引导模式阻止
问题描述
我在反应应用程序中使用引导模式。我需要在用户单击模式的保存按钮后要求他们确认。为了做到这一点,我使用了 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"
});
解决方案
推荐阅读
- node.js - Error getting document ReferenceError: from_data is not defined
- c# - WPF dynamically create formula in TextBox
- python - 为什么在 python 3.5.2 中比较相同的 dict 值会返回 False?
- c# - How to automatically open(click) a HTTP link from a mail body(outlook) message using C# in a Windows Application?
- android - android getting null pointer exception at java.util.Objects.requireNonNull(Objects.java:203)
- react-native - 应用程序在开发中运行良好,但在生成发布 APK 时失败
- blender - Blender:如何将动画导出为 GLTF 文件
- javascript - jQuery在单击单选按钮时使用id而不是值显示div
- c# - 在过滤掉某些属性的同时序列化 JSON.NET JObject
- css - 使用 apoc.load.html 时,是否可以返回完整的 HTML 而不仅仅是文本?