mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-26 01:12:43 -05:00
Fix select option removal and pagination update (#10933)
This commit is contained in:
@@ -177,10 +177,16 @@ export class CustomFieldEditDialogComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
public removeSelectOption(index: number) {
|
public removeSelectOption(index: number) {
|
||||||
this.selectOptions.removeAt(index)
|
const globalIndex =
|
||||||
this._allSelectOptions.splice(
|
index + (this.selectOptionsPage - 1) * SELECT_OPTION_PAGE_SIZE
|
||||||
index + (this.selectOptionsPage - 1) * SELECT_OPTION_PAGE_SIZE,
|
this._allSelectOptions.splice(globalIndex, 1)
|
||||||
1
|
|
||||||
|
const totalPages = Math.max(
|
||||||
|
1,
|
||||||
|
Math.ceil(this._allSelectOptions.length / SELECT_OPTION_PAGE_SIZE)
|
||||||
)
|
)
|
||||||
|
const targetPage = Math.min(this.selectOptionsPage, totalPages)
|
||||||
|
|
||||||
|
this.selectOptionsPage = targetPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user