소스 검색

Fixes #7075: Wrap label selectors in quotes to ensure IDs with spaces are properly selected

thatmattlove 4 년 전
부모
커밋
db2993035d

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
netbox/project-static/dist/netbox.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
netbox/project-static/dist/netbox.js.map


+ 1 - 1
netbox/project-static/src/select/api/apiSelect.ts

@@ -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()}`;

+ 1 - 1
netbox/project-static/src/select/static.ts

@@ -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) {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.