palantir/blueprint

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

Open

#648 建立於 2017年2月8日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
P3Package: coreType: bughelp wanted

描述

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.

貢獻者指南