palantir/blueprint

[EditableText] multiline EditableText doesn't grow to show all contents when it should

开放

#648 创建于 2017年2月8日

 (5 条评论) (0 个反应) (0 位负责人)TypeScript (2,167 个派生)batch import
P3Package: coreType: bughelp wanted

仓库指标

星标
 (20,263 个星标)
PR 合并指标
 (平均合并 43天 10小时) (30 天内合并 27 个 PR)

描述

Bug report

  • Package version(s): 3.5.1 (internal)
  • Browser and OS versions: Chrome 57.0.2987.21 beta , OS X 10.11.6

Steps to reproduce

ReactDOM.render(
  <div style={{ width: '100%', height: '100%' }}>
    <EditableText
      value='Put some really long string in here, something that takes up a few hundred pixels width.'
      multiline={true}
    />
  </div>,
  document.body
);

Actual behavior

Bug A (having trouble reproing this again, will report back soon):

  1. Make the window very small so the text should reflow. Refresh the page.
  2. Click inside the EditableText.
  3. Click outside the EditableText, and notice it resizes.

Bug B:

  1. Start with a large window.
  2. Resize the window down to be smaller than the text, notice it is truncated instead of reflowing.
  3. Click inside the EditableText, notice that now reflows onto multiple lines properly.

Expected behavior

For (A), initial state should be sized automatically. For (B), resizing the window (or, more generally, the container of EditableText) should cause it to reflow.

Notes:

  • Calling forceUpdate on an EditableText ref doesn't seem to help, only user interaction does AFAICT.
  • User interaction isn't possible if it's disabled, which leads to a permanently sad state.

贡献者指南