From f06ff85b7d2e1a050b5cc05d94e82e6f9ad2828c Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:46:20 -0700 Subject: [PATCH] Simplify this a bit more --- src-ui/src/app/utils/popper-options.spec.ts | 2 +- src-ui/src/app/utils/popper-options.ts | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src-ui/src/app/utils/popper-options.spec.ts b/src-ui/src/app/utils/popper-options.spec.ts index 9d7671cf6..bf350f94c 100644 --- a/src-ui/src/app/utils/popper-options.spec.ts +++ b/src-ui/src/app/utils/popper-options.spec.ts @@ -8,7 +8,7 @@ describe('popperOptionsReenablePreventOverflow', () => { { name: 'preventOverflow', fn: function () {} }, { name: 'preventOverflow', - fn: function () { + fn: function (arg0) { return }, }, diff --git a/src-ui/src/app/utils/popper-options.ts b/src-ui/src/app/utils/popper-options.ts index 71ac715ce..d52a79c8c 100644 --- a/src-ui/src/app/utils/popper-options.ts +++ b/src-ui/src/app/utils/popper-options.ts @@ -3,15 +3,9 @@ import { Options } from '@popperjs/core' export function popperOptionsReenablePreventOverflow( config: Partial ): Partial { - const preventOverflowModifier = config.modifiers?.find( - (m) => m.name === 'preventOverflow' && m.fn?.length === 0 + config.modifiers = config.modifiers?.filter( + (m) => !(m.name === 'preventOverflow' && m.fn?.length === 0) ) - if (preventOverflowModifier) { - config.modifiers.splice( - config.modifiers.indexOf(preventOverflowModifier), - 1 - ) - } const ogPreventOverflowModifier = config.modifiers.find( (m) => m.name === 'preventOverflow' )