Skip to content

Commit bda6a4f

Browse files
authored
feat(Watermark): update logic to prevent errors (#5791)
* refactor: 修复报错 * refactor: 更新 z-index 值
1 parent b2d9dcb commit bda6a4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/BootstrapBlazor/Components/Watermark/Watermark.razor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function dispose(id) {
5151
const updateWatermark = (records, watermark) => {
5252
for (const record of records) {
5353
for (const dom of record.removedNodes) {
54-
if (dom.classList.contains('bb-watermark-bg')) {
54+
if (dom.classList && dom.classList.contains('bb-watermark-bg')) {
5555
createWatermark(watermark);
5656
return;
5757
}
@@ -90,7 +90,7 @@ const createWatermark = watermark => {
9090
div.style.opacity = '1';
9191
div.style.position = 'absolute';
9292
div.style.inset = '0';
93-
div.style.zIndex = '999';
93+
div.style.zIndex = '9999';
9494
div.classList.add("bb-watermark-bg");
9595

9696
const mark = el.querySelector('.bb-watermark-bg');
@@ -138,7 +138,7 @@ const monitor = watermark => {
138138
clearWatermark(watermark);
139139
return;
140140
}
141-
if (zIndex !== '999') {
141+
if (zIndex !== '9999') {
142142
clearWatermark(watermark);
143143
return;
144144
}

0 commit comments

Comments
 (0)