Merge pull request #11 from apuc/refactoring-and-fix-methods

Fix bug in Url list
This commit is contained in:
MaxOvs19 2022-10-18 14:13:53 +03:00 committed by GitHub
commit 8603ccf76b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

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

View File

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