signavio / react-mentions

@mention people in a textarea
https://react-mentions.vercel.app
Other
2.4k stars 560 forks source link

Textarea height does not increase when placeholder text wraps to next line #742

Open Pradeep17Jadhav opened 3 months ago

Pradeep17Jadhav commented 3 months ago

Steps to reproduce:

  1. Give some fixed width to the container of the textarea. E.g. 50px.
  2. Set a long placeholder
  3. Try adding and removing the text in textarea

Expected behaviour: When the placeholder of textarea is long and wraps to next line, the height of the textarea should increase accordingly so that the placeholder is always visible.

Observed behaviour: When the entered text wraps to next line, the height of the textarea increases automatically. But if the placeholder of textarea wraps to next line, it does not increase the height of the textarea, and the text overflows.

Workaround: ::before can be set to inputbox__highlighter class with the same content as the placeholder.

Suggestion: Provide a boolean prop to enable or disable the height increase as per the placeholder text.

image