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

    Popup Proxy focus issue

    Help
    2
    4
    491
    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.
    • A
      AdrianG last edited by

      Hi

      I’m having a weird focus issue I’m hoping there’s a kind soul here, who can help me with

      The situation is that I have a dialog window with a lot of Input components. It’s a deep component structure and haven’t been able to recreate the problem in codepen.
      Simplified I have a structure that looks a bit like this:

      <form id="form1" runat="server">
         <div id="q-app" class="pageBackground pageHeight .col-12">
            <q-dialog>
               <q-card style="width: 1200px; max-width: 80vw;">
                  <q-input label="no" @focus="FocusChanged('no')">
                  </q-input>
                  <q-popup-proxy :value="show" @input="KeepAlive">
                     <q-card bordered>
                        // Some q-card stuff
                     </q-card>
                  </q-popup-proxy>
                  <q-input label="temp" @focus="FocusChanged('temp')">
                  </q-input>
               </q-card>
            </q-dialog>
         </div>
      </div>
      
      FocusChanged(sender)
      {
         if (sender === 'no')
            this.show = true;
         console.log('FocusChanged')
         console.log(sender)
      },
      

      When the Input named no gets focus, I’m setting a Popup Proxy to be visible. This Popup Proxy has a Card component as content (not really anything inhere, just a q-card-section with an icon and some simple text)
      The KeepAlive method is just an empty method. I have noticed just by having this one I can keep the popup proxy open

      My issue is that when this Popup Proxy is open and I click in a different Input component (like the one called Temp), the following is shown in the console:

      FocusChanged
      temp
      FocusChanged
      no

      At first the FocusChanged method is called correctly, but then for some unknown reason @focus is also called for the field that activated the opening of the popup, causing it to regain focus instead of setting focus to the component that I clicked in

      I tried recreating it here, but it works even less here than in my actual code: https://codepen.io/Adagio_B/pen/vYGjLPr?editors=1010
      In the codepen the popup proxy is locking everything behind from being clicked in, in my actual code this is not the case. I can’t see why it locks everything in codepen, but not in my actual code. The situation in my actual code is correct; it should not lock everything as this popup should just be used as an optional tool/info for the user

      Anybody who has any idea what could be wrong?

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

        @AdrianG your QPopupProxy don’t have parent, should be a child of your input. Imo, if you want it to be generic for both input, then better use a QDialog instead.

        A 2 Replies Last reply Reply Quote 1
        • A
          AdrianG @metalsadman last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • A
            AdrianG @metalsadman last edited by

            @metalsadman

            Thanks. I tried changing it to a Q-dialog, but the issue is still the same. Same thing happened when I added it as a child to my input
            It’s not high priority, so maybe I’ll try to fix it some other day

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