palantir/blueprint

TextArea with growVertically doesn't get decreased when removing text

Open

#3,860 opened on 2019年11月19日

GitHub で見る
 (3 comments) (4 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
P2Package: coreType: enhancementhelp wanted

説明

Environment

  • Package version(s): 3.18.0
  • Browser and OS versions: Safari 13.0.3 running at macOS 10.15.1 (originally found this bug Electron 5.0.3 that comes with Chrome 73.0, macOS, Windows)

Reproducing example

Steps to reproduce

  1. Open link to the example above;
  2. Focus at the TextArea;
  3. Select all and remove text content from the TextArea, either remove in any other way.

Actual behavior

TextArea component doesn't decrease its height.

Expected behaviour

TextArea is decreasing height according to the content height.

Possible solution

As I can see, TextArea uses its scrollHeight property that, seems like won't change after height has been already set and the content is less than element height. So we could try to reset it's height to auto (or other little value like a 10px) and then set actual height from scrollHeight. But it may cause some jumping so needs tests in the real-world. Looking for another workarounds, so I'll return here in case of success.

Hope this is not a duplicate since it would be time blowing for me and you!⌛️

コントリビューターガイド