palantir/blueprint

TextArea with growVertically doesn't get decreased when removing text

开放

#3,860 创建于 2019年11月19日

 (3 条评论) (4 个反应) (0 位负责人)TypeScript (2,167 个派生)batch import
P2Package: coreType: enhancementhelp wanted

仓库指标

星标
 (20,263 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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!⌛️

贡献者指南