mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-01 01:46:16 +00:00
Chore: remove popper preventOverflow fix (#9306)
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user