Coder Social home page Coder Social logo

Comments (5)

joshaber avatar joshaber commented on June 29, 2024

(Sorry for taking so long to answer!)

Ah, yeah, so this is kinda interesting.

Input has a default frame:

super.init(frame: CGRect(x: 0, y: 0, width: 100, height: 23))

which means the layout algorithm will use that instead of taking into account stretchedness, etc. You can fix that by giving it an undefined width:

Input(...).width(Node.Undefined)

Then it'll stretch as you'd expect.

But also, be sure to update Few. I just fixed a bug (#80) that would cause the above fix to crash :trollface:

from few.swift.

joshdholtz avatar joshdholtz commented on June 29, 2024

@joshaber I was about to say thanks for answering so quickly! I know how hard it is to stay on top of things 😇 But I will give that a shot! And is there any reason why Input has a default width of 100?

from few.swift.

joshaber avatar joshaber commented on June 29, 2024

And is there any reason why Input has a default width of 100?

Mostly because at the time it seemed like a good idea to have a reasonable default frame. Probably worth revisiting now.

from few.swift.

joshdholtz avatar joshdholtz commented on June 29, 2024

That is valid reasoning 👌 I just want to prevent others from getting hung up on the same thing like I did. Few is super easy to use and I don't want this to deter others from using it if they run into it 😊 I could work on a PR for it if you wouldn't mind.

from few.swift.

joshaber avatar joshaber commented on June 29, 2024

I could work on a PR for it if you wouldn't mind.

That'd be great! I wonder if we should still have a default but leave the width undefined?

from few.swift.

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.