We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f3514c3 + 31984fc commit 6a61009Copy full SHA for 6a61009
1 file changed
src/components/modal/index.ts
@@ -81,7 +81,6 @@ class Modal implements ModalInterface {
81
_createBackdrop() {
82
if (this._isHidden) {
83
const backdropEl = document.createElement('div');
84
- backdropEl.setAttribute('modal-backdrop', '');
85
backdropEl.classList.add(
86
...this._options.backdropClasses.split(' ')
87
);
@@ -91,8 +90,9 @@ class Modal implements ModalInterface {
91
90
}
92
93
_destroyBackdropEl() {
94
- if (!this._isHidden) {
95
- document.querySelector('[modal-backdrop]').remove();
+ if (!this._isHidden && this._backdropEl) {
+ this._backdropEl.remove();
+ this._backdropEl = null
96
97
98
0 commit comments