Skip to content

Commit 177f4a8

Browse files
fix: remove-item button icon with HTML autocomplete labels
1 parent e5401a7 commit 177f4a8

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-smartbase-admin"
3-
version = "2.3.7"
3+
version = "2.3.8"
44
description = ""
55
authors = ["SmartBase <info@smartbase.sk>"]
66
readme = "README.md"

src/django_smartbase_admin/static/sb_admin/src/js/choices.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ export const choicesJSOptions = (choiceInput, options = {}) => ({
2727
item: (templateOptions, item, removeItemButton) => {
2828
const originalItem = Choices.defaults.templates.item.call(this, templateOptions, withSanitizedLabel(item), removeItemButton)
2929
if (removeItemButton) {
30-
originalItem.children[0].innerHTML = ''
31-
originalItem.children[0].appendChild(createIcon('Close-small', []))
30+
const removeButton = originalItem.querySelector('[data-button]')
31+
if (removeButton) {
32+
removeButton.innerHTML = ''
33+
removeButton.appendChild(createIcon('Close-small', []))
34+
}
3235
}
3336
return originalItem
3437
},

0 commit comments

Comments
 (0)