No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    What's the proper way to use a `q-modal-layout` with a `<div slot="footer">` along with a form tag?

    Framework
    5
    16
    1682
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • s.molinari
      s.molinari last edited by

      Yes. And with Vue, you don’t need the form tag for submitting the form data to the server. At most, you need it for accessibility.

      Scott

      1 Reply Last reply Reply Quote 0
      • T
        toymachiner62 last edited by

        Exactly. So is quasar promoting not doing things correctly and breaking accessibility? Using form tags helps a lot of things including using the enter key to submit a form. There’s obvious “hacks” including capturing key bindings to submit forms, etc. but IMO this is not the correct way to do things.

        If quasar is not going to address this i guess i’ll have to not use the form and capture key bindings, but it’s my suggestion/recommendation to address things like this in the quasar framework. Vue doesn’t promote this behavior and neither should quasar.

        1 Reply Last reply Reply Quote 0
        • metalsadman
          metalsadman last edited by metalsadman

          I use form tag a lot too (as means of accessibility) and have to be mindful where to put them since it usually breaks the quasar component styling. maybe you can put a feature request for this in their github page.

          1 Reply Last reply Reply Quote 1
          • s.molinari
            s.molinari last edited by

            Btw, your fiddle works perfectly for me in both FF and Chrome. The red footer stays at the bottom, no matter what I do with screen size, even when using the minimized prop.

            Scott

            T 1 Reply Last reply Reply Quote 0
            • T
              toymachiner62 @s.molinari last edited by

              @s-molinari The difference is what scrolls. WIth form tag the entire modal scrolls. Without form tag, footer is a sticky footer in the modal and the rest of the content scrolls

              0_1543182274867_f7085148-66d0-4c14-a697-60faecc9b7a7-image.png

              0_1543182377957_a89cc55a-1550-4820-9674-4f0047dda494-image.png

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by

                Ah. Ok. That is a different problem than what was described originally.

                Maybe @rstoenescu can make a suggestion.

                Scott

                1 Reply Last reply Reply Quote 0
                • Z
                  zeidanbm last edited by

                  I think this is a css problem and doesn’t have to do anything with quasar. check this codepen (https://codepen.io/zeidanbm/pen/wQEjBB)
                  The trick is to use flexbox to style it and make sure no scroll is set on parent while wrapper child will have scroll.

                  1 Reply Last reply Reply Quote 1
                  • rstoenescu
                    rstoenescu Admin last edited by

                    Way to do it: https://jsfiddle.net/rstoenescu/sza3qncg/4/

                    Few comments:

                    1. Quoting you: “So is quasar promoting not doing things correctly and breaking accessibility?” and “my suggestion/recommendation to address things like this in the quasar framework” --> No, Quasar was actually the first Vue framework working on accessibility. We take great pride in the components being accessible.

                    2. This confusion of yours comes from the fact that you are misunderstanding the concept of a slot. You’re using slot=“footer” yet you wrap it with a DOM element (<form>). Slots are strictly connected to the component upon which you are using them, and it’s equivalent to saying: “hey, component X, this slot needs this content” then the component fills its own template (not your template!) with the indicated slot content. So, wrapping a slot with an element makes no sense… because it’s a slot, it’s not content that you can wrap or place in a specific DOM tree of your choosing for the component — the component decides where to put it.

                    3. Finally, some thing that you should be aware of regarding your comment “Vue doesn’t promote this behavior and neither should quasar”: You are operating with Vue components, not native form elements. <form> is designed for native form elements. In any case, this is not to be taken as "Quasar components don’t work with <form>", because QInput, QButton (which actually even has a “type” prop: submit, reset, …), … do work. But just be aware these are components, not native form elements.

                    -Razvan

                    1 Reply Last reply Reply Quote 2
                    • s.molinari
                      s.molinari last edited by s.molinari

                      Oh brother. Why didn’t I think of putting the layout in the form element…feeling stupid. 😄

                      Scott

                      1 Reply Last reply Reply Quote 0
                      • T
                        toymachiner62 last edited by

                        🤦🏻♂ That makes 2 of us @s-molinari

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post