fix: WaterMark blink when scale of window (#47895)

* fix: WaterMark blink when scale of window

* chore: fix mutation

---------

Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
二货爱吃白萝卜 2024-03-18 15:39:06 +08:00 committed by GitHub
parent 3278ce7d3a
commit de8657bf3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,8 +50,12 @@ export default function useWatermark(
// Prevents using the browser `Hide Element` to hide watermarks
watermarkEle.removeAttribute('class');
container.append(watermarkEle);
if (watermarkEle.parentElement !== container) {
container.append(watermarkEle);
}
}
return watermarkMap.get(container);
};
const removeWatermark = (container: HTMLElement) => {