mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #7075: Wrap label selectors in quotes to ensure IDs with spaces are properly selected
This commit is contained in:
4
netbox/project-static/dist/netbox.js
vendored
4
netbox/project-static/dist/netbox.js
vendored
File diff suppressed because one or more lines are too long
2
netbox/project-static/dist/netbox.js.map
vendored
2
netbox/project-static/dist/netbox.js.map
vendored
File diff suppressed because one or more lines are too long
@ -715,7 +715,7 @@ export class APISelect {
|
||||
private getPlaceholder(): string {
|
||||
let placeholder = this.name;
|
||||
if (this.base.id) {
|
||||
const label = document.querySelector(`label[for=${this.base.id}]`) as HTMLLabelElement;
|
||||
const label = document.querySelector(`label[for="${this.base.id}"]`) as HTMLLabelElement;
|
||||
// Set the placeholder text to the label value, if it exists.
|
||||
if (label !== null) {
|
||||
placeholder = `Select ${label.innerText.trim()}`;
|
||||
|
@ -4,7 +4,7 @@ import { getElements } from '../util';
|
||||
export function initStaticSelect(): void {
|
||||
for (const select of getElements<HTMLSelectElement>('.netbox-static-select')) {
|
||||
if (select !== null) {
|
||||
const label = document.querySelector(`label[for=${select.id}]`) as HTMLLabelElement;
|
||||
const label = document.querySelector(`label[for="${select.id}"]`) as HTMLLabelElement;
|
||||
|
||||
let placeholder;
|
||||
if (label !== null) {
|
||||
|
Reference in New Issue
Block a user