Code Monkey home page Code Monkey logo

Comments (5)

chrschorn avatar chrschorn commented on June 11, 2024

If you want to make them line up, try either giving both elements a label or none of them:

with ui.row():
    ui.input(value="Input")
    ui.select(["Option 1", "Option 2"], value="Option 1")

with ui.row():
    ui.input("Input", value="value")
    ui.select(["Option 1", "Option 2"], value="Option 1", label="Select")

image

from nicegui.

me21 avatar me21 commented on June 11, 2024

Thank you, I feel stupid 🥴

from nicegui.

falkoschindler avatar falkoschindler commented on June 11, 2024

@chrschorn I just wonder why both elements are well aligned on a plain Quasar page - independent of labels:

<!DOCTYPE html>
<html>
  <head>
    <link
      href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons"
      rel="stylesheet"
      type="text/css"
    />
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/quasar.prod.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div id="q-app">
      <div class="row">
        <q-input label="Input" model-value="input value" />
        <q-select model-value="A" />
      </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/quasar.umd.prod.js"></script>
    <script>
      const app = Vue.createApp({ setup: () => {} });
      app.use(Quasar);
      app.mount("#q-app");
    </script>
  </body>
</html>

Screenshot 2024-05-02 at 11 07 33

from nicegui.

me21 avatar me21 commented on June 11, 2024

@falkoschindler oh, I'm not sure what's going on here then. Feel free to reopen the issue.

from nicegui.

falkoschindler avatar falkoschindler commented on June 11, 2024

@me21 I found my mistake! We can't use auto-closing tags in HTML. Instead we need to write

<div class="row">
  <q-input label="Input" model-value="input value"></q-input>
  <q-select model-value="A"></q-select>
</div>

This way Quasar yields the same result like NiceGUI. And if you think about it, it makes sense to vertically align the select value in the middle (next to the arrow) if there is no label. If there was no input element, the ui.select without a label would look strange with a value shifted towards the bottom.

from nicegui.

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.