mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Chore: remove popper preventOverflow fix (#9306)
This commit is contained in:
parent
f8aaa5cb32
commit
bed82215a0
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
||||
|
@ -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')
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user