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

    Error after upgrade to latest version for triggering QBtn on enter

    Framework
    4
    6
    482
    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
      Sheejavarghese6 last edited by

      I am having a log in page username and password field . When we are finished typing password and press enter , I triggered to call the click function of QBtn . It was working fine before update. Now I get the below mentioned errror.
      TypeError: Cannot read property ‘defaultPrevented’ of undefined
      at VueComponent.click (QBtn.js?9c40:48)
      at VueComponent.trigger (master.vue?4509:119)
      at keyup (master.vue?19fd:125)
      at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
      at HTMLInputElement.invoker (vue.runtime.esm.js?2b0e:2179)
      at HTMLInputElement.original._wrapper (vue.runtime.esm.js?2b0e:6911)
      logError @ vue.runtime.esm.js?2b0e:1888
      globalHandleError @ vue.runtime.esm.js?2b0e:1879
      handleError @ vue.runtime.esm.js?2b0e:1839
      invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1862
      invoker @ vue.runtime.esm.js?2b0e:2179
      original._wrapper @ vue.runtime.esm.js?2b0e:6911

      Now I have to click on the button to log in. What could be the reason?

      1 Reply Last reply Reply Quote 0
      • A
        Amine2 last edited by

        In order for the user to be able to activate the @submit events on the form, create a QBtn with type set to submit

            <q-form
              @submit.prevent="yourSubmitMethod"
            >
               // your form
                <q-btn label="Submit" type="submit" color="primary"/>
            </q-form>
        
        1 Reply Last reply Reply Quote 0
        • J
          jelices last edited by

          Same problem here. I had a piece of working code which has stopped working. Just to make sure, I have just updated Quasar to 1.2.5 and so on, and the error persists. In my case the <q-btn> tag has a ref="button" which is contained in a <q-tab-panel name="whatever" @keyup.enter.native="$refs.button.click()">. Pressing the enter key was triggering the click action of the button. Now it gives the error above. Thanks.

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

            $refs.button.$el.click()

            1 Reply Last reply Reply Quote 0
            • J
              jelices last edited by

              Yes, it does work with $el. Thanks a lot!

              1 Reply Last reply Reply Quote 0
              • J
                jelices last edited by

                For those who want to know why this is so or shed some additional light, check: https://stackoverflow.com/questions/58546283/why-is-el-sometimes-necessary-when-using-refs-in-vue

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