briskml / brisk

✨Cross-platform set of tools for building native UIs with Reason/OCaml
MIT License
553 stars 9 forks source link

Sometimes Text component renders either all or none lines of multiline text #87

Open wokalski opened 5 years ago

wokalski commented 5 years ago
let examples = (~children as _: list(unit), ()) =>
  Brisk.Layout.(
    <view
      style=[
        width(100.),
        /* If you change height to 80. you'll observe
         * that all of the sudden two lines of the second text are rendered
         * With 79, I'd expect to see at least one line of the second text component
         */
        height(79.),
      ]>
      <view style=[padding4(~top=20., ())]>
        <text
          style=[
            background(Color.rgb(0, 255, 0)),
            font(~size=13., ()),
            lineBreak(`TruncateTail),
            color(Color.hex("#000000")),
          ]
          value="Anonononother another another"
        />
        <text
          style=Brisk.Layout.[
            lineBreak(`TruncateTail),
            background(Color.rgb(255, 0, 0)),
            color(Color.hex("#888888")),
          ]
          value="Long Long Long Long string"
        />
      </view>
    </view>
  );
rauanmayemir commented 5 years ago

I thought multiline was the bane of all cocoa developers? 😁