Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Chore: remove popper preventOverflow fix (#9306)

shamoonbed82215a00d
diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts
index b31ba6c09..479f072a1 100644
--- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts
+++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts
@@ -34,7 +34,7 @@ import {
CustomFieldQueryElement,
CustomFieldQueryExpression,
} from 'src/app/utils/custom-field-query-element'
-import { popperOptionsReenablePreventOverflow } from 'src/app/utils/popper-options'
+import { pngxPopperOptions } from 'src/app/utils/popper-options'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.component'
import { DocumentLinkComponent } from '../input/document-link/document-link.component'
@@ -183,7 +183,7 @@ export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPerm
public CustomFieldDataType = CustomFieldDataType
public CUSTOM_FIELD_QUERY_MAX_DEPTH = CUSTOM_FIELD_QUERY_MAX_DEPTH
public CUSTOM_FIELD_QUERY_MAX_ATOMS = CUSTOM_FIELD_QUERY_MAX_ATOMS
- public popperOptions = popperOptionsReenablePreventOverflow
+ public popperOptions = pngxPopperOptions
@Input()
title: string
diff --git a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts
index e7d506d18..50565aaa2 100644
--- a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts
+++ b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts
@@ -19,7 +19,7 @@ import { debounceTime } from 'rxjs/operators'
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
import { SettingsService } from 'src/app/services/settings.service'
import { ISODateAdapter } from 'src/app/utils/ngb-iso-date-adapter'
-import { popperOptionsReenablePreventOverflow } from 'src/app/utils/popper-options'
+import { pngxPopperOptions } from 'src/app/utils/popper-options'
import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.component'
export interface DateSelection {
@@ -55,7 +55,7 @@ export enum RelativeDate {
],
})
export class DatesDropdownComponent implements OnInit, OnDestroy {
- public popperOptions = popperOptionsReenablePreventOverflow
+ public popperOptions = pngxPopperOptions
constructor(settings: SettingsService) {
this.datePlaceHolder = settings.getLocalizedDateInputFormat()
diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts
index 4e3d280dc..34320003e 100644
--- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts
+++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts
@@ -17,7 +17,7 @@ import { ObjectWithPermissions } from 'src/app/data/object-with-permissions'
import { FilterPipe } from 'src/app/pipes/filter.pipe'
import { HotKeyService } from 'src/app/services/hot-key.service'
import { SelectionDataItem } from 'src/app/services/rest/document.service'
-import { popperOptionsReenablePreventOverflow } from 'src/app/utils/popper-options'
+import { pngxPopperOptions } from 'src/app/utils/popper-options'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.component'
import {
@@ -380,7 +380,7 @@ export class FilterableDropdownComponent
@ViewChild('dropdown') dropdown: NgbDropdown
@ViewChild('buttonItems') buttonItems: ElementRef
- public popperOptions = popperOptionsReenablePreventOverflow
+ public popperOptions = pngxPopperOptions
filterText: string
diff --git a/src-ui/src/app/utils/popper-options.spec.ts b/src-ui/src/app/utils/popper-options.spec.ts
index 2d3ded6f6..b8592d8c9 100644
--- a/src-ui/src/app/utils/popper-options.spec.ts
+++ b/src-ui/src/app/utils/popper-options.spec.ts
@@ -1,11 +1,10 @@
import { Options } from '@popperjs/core'
-import { popperOptionsReenablePreventOverflow } from './popper-options'
+import { pngxPopperOptions } from './popper-options'
describe('popperOptionsReenablePreventOverflow', () => {
- it('should return the config without the empty fun preventOverflow, add padding to other', () => {
+ it('should return the config with add padding', () => {
const config: Partial<Options> = {
modifiers: [
- { name: 'preventOverflow', fn: function () {} },
{
name: 'preventOverflow',
fn: function (arg0) {
@@ -15,7 +14,7 @@ describe('popperOptionsReenablePreventOverflow', () => {
],
}
- const result = popperOptionsReenablePreventOverflow(config)
+ const result = pngxPopperOptions(config)
expect(result.modifiers.length).toBe(1)
expect(result.modifiers[0].name).toBe('preventOverflow')
diff --git a/src-ui/src/app/utils/popper-options.ts b/src-ui/src/app/utils/popper-options.ts
index d52a79c8c..dd3ec3119 100644
--- a/src-ui/src/app/utils/popper-options.ts
+++ b/src-ui/src/app/utils/popper-options.ts
@@ -1,16 +1,11 @@
import { Options } from '@popperjs/core'
-export function popperOptionsReenablePreventOverflow(
- config: Partial<Options>
-): Partial<Options> {
- config.modifiers = config.modifiers?.filter(
- (m) => !(m.name === 'preventOverflow' && m.fn?.length === 0)
- )
- const ogPreventOverflowModifier = config.modifiers.find(
+export function pngxPopperOptions(config: Partial<Options>): Partial<Options> {
+ const preventOverflowModifier = config.modifiers.find(
(m) => m.name === 'preventOverflow'
)
- if (ogPreventOverflowModifier) {
- ogPreventOverflowModifier.options = {
+ if (preventOverflowModifier) {
+ preventOverflowModifier.options = {
padding: 10,
}
}