mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Merge pull request #2625 from paperless-ngx/fix-2465
Fix: tags dropdown should stay closed when removing
This commit is contained in:
commit
2d9fa58157
@ -17,7 +17,7 @@
|
|||||||
(blur)="onBlur()">
|
(blur)="onBlur()">
|
||||||
|
|
||||||
<ng-template ng-label-tmp let-item="item">
|
<ng-template ng-label-tmp let-item="item">
|
||||||
<span class="tag-wrap tag-wrap-delete" (click)="removeTag(item.id)">
|
<span class="tag-wrap tag-wrap-delete" (mousedown)="removeTag($event, item.id)">
|
||||||
<svg width="1.2em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
<svg width="1.2em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||||
<use xlink:href="assets/bootstrap-icons.svg#x"/>
|
<use xlink:href="assets/bootstrap-icons.svg#x"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -65,7 +65,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
|
|
||||||
private _lastSearchTerm: string
|
private _lastSearchTerm: string
|
||||||
|
|
||||||
getTag(id) {
|
getTag(id: number) {
|
||||||
if (this.tags) {
|
if (this.tags) {
|
||||||
return this.tags.find((tag) => tag.id == id)
|
return this.tags.find((tag) => tag.id == id)
|
||||||
} else {
|
} else {
|
||||||
@ -73,7 +73,10 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
removeTag(id) {
|
removeTag(event: PointerEvent, id: number) {
|
||||||
|
// prevent opening dropdown
|
||||||
|
event.stopImmediatePropagation()
|
||||||
|
|
||||||
let index = this.value.indexOf(id)
|
let index = this.value.indexOf(id)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
let oldValue = this.value
|
let oldValue = this.value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user