Giter Club home page Giter Club logo

Comments (5)

chibicode avatar chibicode commented on May 10, 2024 1

On /test: Text node directly under a flex container is failing

<div
  style={{
    display: 'flex',
    height: '100%',
    width: '100%',
    alignItems: 'center',
    justifyContent: 'center',
    flexDirection: 'column',
  }}
>
  Hello World
</div>

Screen Shot 2022-02-07 at 1 50 54 AM

It works if you put another div:

<div
  style={{
    display: 'flex',
    height: '100%',
    width: '100%',
    alignItems: 'center',
    justifyContent: 'center',
    flexDirection: 'column',
  }}
>
  <div>Hello World</div>
</div>

Screen Shot 2022-02-07 at 1 54 30 AM

from satori.

shuding avatar shuding commented on May 10, 2024 1

@chibicode that should be fixed with #16 🎉

from satori.

chibicode avatar chibicode commented on May 10, 2024

Update: Fixed in #7

  • In this example, seems like the height of the absolutely positioned square is affecting the position of the center square
CleanShot.2022-02-04.at.03.05.24.mp4
export default function Card({ withSatori }) {
  return withSatori(
    <div
      style={{
        display: 'flex',
        height: '100%',
        width: '100%',
        alignItems: 'center',
        justifyContent: 'center',
        flexDirection: 'column',
      }}
    >
      <div
        style={{
          display: 'flex',
          flexDirection: 'column',
          alignItems: 'center',
          width: 100,
          height: 100,
          textAlign: 'center',
          backgroundColor: '#000',
        }}
      >
      </div>
      <div
        style={{
          left: 0,
          top: 0,
          position: 'absolute',
          display: 'flex',
          alignItems: 'center',
        }}
      >
        <span
          style={{
            width: 100,
            height: 100,
            background: 'black',
          }}
        />
      </div>
    </div>
  )
}
  • Also, this doesn't seem to work:
CleanShot.2022-02-04.at.03.19.02.mp4
export default function Card({ withSatori }) {
  return withSatori(
    <div
    style={{
      display: 'flex',
      height: '100%',
      width: '100%',
      alignItems: 'center',
      justifyContent: 'center',
      flexDirection: 'column',
    }}
  >
    <div
      style={{
        display: 'flex',
        flexDirection: 'column',
        alignItems: 'center',
        width: 100,
        height: 100,
        textAlign: 'center',
        backgroundColor: '#000',
      }}
    >
    </div>
    <div
      style={{
        left: 0,
        top: 0,
        position: 'absolute',
        width: 100,
        height: 100,
        background: 'red',
      }}
    >
    </div>
  </div>
  )
}

from satori.

shuding avatar shuding commented on May 10, 2024

I think that bug can be solved with #6 by adding another virtual container. However It's currently tricky because Yoga doesn't support inline/floating elements. So to support inline elements (e.g. Emoji), we currently make each "word" a node, and the parent container a flex box with wrapping enabled:

CleanShot 2022-02-08 at 12 38 09@2x

If we use a virtual container (only for text fragments), it will become:

CleanShot 2022-02-08 at 12 38 48@2x

I'll think again about this.

from satori.

shuding avatar shuding commented on May 10, 2024

Both bugs were fixed! 🎉

from satori.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.