react-mentions icon indicating copy to clipboard operation
react-mentions copied to clipboard

Large scroll height in textarea causes large blank space and displaced suggestions menu beneath textarea

Open m-mitchell opened this issue 3 years ago • 1 comments

Steps to reproduce:

  1. Create a MentionsInput component with Mentions and suggestions
  2. Enter or paste a large amount of text in the textarea so that it has many lines

Expected behaviour:

Textarea should scroll and the mentions menu should appear near where the user is entering a mention. There should be no blank space below the textarea unless added by another component.

Observed behaviour:

One of the sibling divs to the textarea becomes extremely long (possibly matching the full height of the textarea before applying scroll?) The mentions menu appears at the bottom of the sibling div.

Screen Shot 2022-03-28 at 2 12 13 PM

https://user-images.githubusercontent.com/169674/160489210-bac69c7b-4ba0-4e66-9375-cd19b9eb85f7.mov

Workaround:

Setting the sibling div to display:none seems to fix the issue but I'm not sure what this div is for, so this might not be a good idea.

m-mitchell avatar Mar 28 '22 21:03 m-mitchell

The div causing the problem is the highlighter div. Since we aren't using highlighting for our use case, I just set display: none as a workaround. Someone who runs into this bug and wants to use highlighting would have to find a different solution.

m-mitchell avatar Mar 31 '22 00:03 m-mitchell