Skip to content

Commit

Permalink
Fix #5363: Mention better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Nov 22, 2023
1 parent 3084230 commit e055702
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions components/lib/mention/Mention.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e055702

Please sign in to comment.