[BUGFIX] duplicate ids checkboxes in sidebar form
This commit is contained in:
@ -189,6 +189,17 @@ function initTripSidebar(triggerElement: HTMLElement) {
|
||||
let body = <HTMLElement>document.querySelector(triggerElement.dataset.body);
|
||||
let bodyElement = <HTMLElement>body.cloneNode(true);
|
||||
let bodyContainerElement = <HTMLElement>sidebarElement.querySelector('.body-js');
|
||||
|
||||
/* Quickfix duplicate ids checkboxes */
|
||||
const checkboxes = <NodeListOf<HTMLElement>>bodyElement.querySelectorAll('input[type="checkbox"]');
|
||||
|
||||
Array.prototype.forEach.call(checkboxes, (checkbox: HTMLElement) => {
|
||||
if(checkbox) {
|
||||
checkbox.parentElement?.setAttribute('for', checkbox.id + 'js');
|
||||
checkbox.id += 'js';
|
||||
}
|
||||
});
|
||||
|
||||
if(bodyContainerElement) {
|
||||
bodyContainerElement.innerHTML = '';
|
||||
bodyContainerElement.append(bodyElement);
|
||||
|
Reference in New Issue
Block a user