mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix null parentNode when rendering emby-select in react
This commit is contained in:
parent
52c45bae42
commit
e77b4b87c1
1 changed files with 3 additions and 3 deletions
|
@ -138,15 +138,15 @@ import 'webcomponents.js/webcomponents-lite';
|
||||||
label.innerHTML = this.getAttribute('label') || '';
|
label.innerHTML = this.getAttribute('label') || '';
|
||||||
label.classList.add('selectLabel');
|
label.classList.add('selectLabel');
|
||||||
label.htmlFor = this.id;
|
label.htmlFor = this.id;
|
||||||
this.parentNode.insertBefore(label, this);
|
this.parentNode?.insertBefore(label, this);
|
||||||
|
|
||||||
if (this.classList.contains('emby-select-withcolor')) {
|
if (this.classList.contains('emby-select-withcolor')) {
|
||||||
this.parentNode.insertAdjacentHTML('beforeend', '<div class="selectArrowContainer"><div style="visibility:hidden;display:none;">0</div><span class="selectArrow material-icons keyboard_arrow_down"></span></div>');
|
this.parentNode?.insertAdjacentHTML('beforeend', '<div class="selectArrowContainer"><div style="visibility:hidden;display:none;">0</div><span class="selectArrow material-icons keyboard_arrow_down"></span></div>');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
EmbySelectPrototype.setLabel = function (text) {
|
EmbySelectPrototype.setLabel = function (text) {
|
||||||
const label = this.parentNode.querySelector('label');
|
const label = this.parentNode?.querySelector('label');
|
||||||
|
|
||||||
label.innerHTML = text;
|
label.innerHTML = text;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue