openkraken / kraken

A web standards-compliant, high-performance rendering engine based on Flutter.
https://openkraken.com
Apache License 2.0
4.93k stars 304 forks source link

flex-shrink: 0 容器中的文本未正确换行展示 #1355

Closed temper357 closed 2 years ago

temper357 commented 2 years ago

使用的 Kraken 版本 | What version of kraken are you using

main

重现代码 | Code example:

  it('text wrap bug', async () => {
    let div;

    div = createElement('div', {
        style: {
            display: 'flex',
            flexDirection: 'column',
        }
    }, [
       (div3 = createElement('div', {
        style: {
          display: 'flex',
          flexDirection: 'column',
          alignItems: 'flex-start',
          flexShrink: 0,
          height: '100px'
        },
      },
      [
         createElement('span', {
             style: {
               lineHeight: '18px',
             }
         }, [
            createText('just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines just two lines')
         ])
      ]
    ))
    ]);

    BODY.appendChild(div);

    await snapshot();
  });

预期结果 | Expected results: image

实际结果 | Actual results: image