mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #3348 from thornbill/fix-react-emby-select
Fix unstyled emby-select field when rendered with React
This commit is contained in:
commit
984aa39c4a
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@ import globalize from '../../../scripts/globalize';
|
|||
|
||||
const createSelectElement = ({ className, id, label }) => ({
|
||||
__html: `<select
|
||||
className="${className}"
|
||||
class="${className}"
|
||||
is="emby-select"
|
||||
id="${id}"
|
||||
label="${label}"
|
||||
|
|
|
@ -138,15 +138,15 @@ import 'webcomponents.js/webcomponents-lite';
|
|||
label.innerHTML = this.getAttribute('label') || '';
|
||||
label.classList.add('selectLabel');
|
||||
label.htmlFor = this.id;
|
||||
this.parentNode.insertBefore(label, this);
|
||||
this.parentNode?.insertBefore(label, this);
|
||||
|
||||
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) {
|
||||
const label = this.parentNode.querySelector('label');
|
||||
const label = this.parentNode?.querySelector('label');
|
||||
|
||||
label.innerHTML = text;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue