From 4c1ff399d0d60bdcb79cbaf55ee44b252ea23fef Mon Sep 17 00:00:00 2001
From: melloware <mellowaredev@gmail.com>
Date: Tue, 9 Jan 2024 10:07:58 -0500
Subject: [PATCH] Fix #5363: Mention better fix

---
 components/lib/mention/Mention.js | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/components/lib/mention/Mention.js b/components/lib/mention/Mention.js
index eb8fa36f3e..c201b38633 100644
--- a/components/lib/mention/Mention.js
+++ b/components/lib/mention/Mention.js
@@ -2,7 +2,7 @@ import * as React from 'react';
 import PrimeReact, { PrimeReactContext } from '../api/Api';
 import { useHandleStyle } from '../componentbase/ComponentBase';
 import { CSSTransition } from '../csstransition/CSSTransition';
-import { useMountEffect, useOverlayListener, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks';
+import { useOverlayListener, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks';
 import { InputTextarea } from '../inputtextarea/InputTextarea';
 import { OverlayService } from '../overlayservice/OverlayService';
 import { Portal } from '../portal/Portal';
@@ -92,10 +92,6 @@ export const Mention = React.memo(
         };
 
         const alignOverlay = () => {
-            if (!triggerState) {
-                return;
-            }
-
             const { key, index } = triggerState;
             const value = inputRef.current.value;
             const position = DomHandler.getCursorOffset(inputRef.current, value.substring(0, index - 1), value.substring(index), key);
@@ -356,10 +352,6 @@ export const Mention = React.memo(
             ObjectUtils.combinedRefs(inputRef, props.inputRef);
         }, [inputRef, props.inputRef]);
 
-        useMountEffect(() => {
-            alignOverlay();
-        });
-
         useUpdateEffect(() => {
             if (searchingState) {
                 props.suggestions && props.suggestions.length ? show() : hide();