Fix bug in Url list

This commit is contained in:
Макс Овсяников 2022-10-18 14:13:14 +03:00
parent 49223343cf
commit a95f6cc100
2 changed files with 7 additions and 5 deletions

View File

@ -368,8 +368,8 @@ export class DropDown {
} }
} else { } else {
if (multiselectTag) { if (multiselectTag) {
const tagItem = document.getElementById(`tag-${index}`); const tagItem = document.getElementById(`tag-${index}-${item.id}`);
// TODO: bug error! in url
ul.removeChild(tagItem); ul.removeChild(tagItem);
} }
this.#indexes.splice(checkIndex, 1); this.#indexes.splice(checkIndex, 1);

View File

@ -4,7 +4,6 @@ import { customStylesFormat } from './utils';
export function createBreadcrumb(data, title, index, id) { export function createBreadcrumb(data, title, index, id) {
const { element, option, indexes, selectedItems } = data; const { element, option, indexes, selectedItems } = data;
const { placeholder, styles } = option; const { placeholder, styles } = option;
const { chips } = styles;
const selected = element.querySelector('.selected'); const selected = element.querySelector('.selected');
const liChip = document.createElement('li'); const liChip = document.createElement('li');
@ -16,7 +15,7 @@ export function createBreadcrumb(data, title, index, id) {
svgIcon.setAttribute('viewBox', '0 0 10 10'); svgIcon.setAttribute('viewBox', '0 0 10 10');
path1.setAttribute('d', 'M3,7 L7,3'); path1.setAttribute('d', 'M3,7 L7,3');
path2.setAttribute('d', 'M3,3 L7,7'); path2.setAttribute('d', 'M3,3 L7,7');
liChip.setAttribute('id', `tag-${index}`); liChip.setAttribute('id', `tag-${index}-${id}`);
svgIcon.classList.add('svg-icon'); svgIcon.classList.add('svg-icon');
@ -25,7 +24,10 @@ export function createBreadcrumb(data, title, index, id) {
liChip.appendChild(textNode); liChip.appendChild(textNode);
liChip.appendChild(svgIcon); liChip.appendChild(svgIcon);
customStylesFormat(chips, liChip); if (styles) {
const { chips } = styles;
customStylesFormat(chips, liChip);
}
svgIcon.addEventListener('click', (event) => { svgIcon.addEventListener('click', (event) => {
event.stopPropagation(); event.stopPropagation();