Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

q-tab click event handler has no 'go' argument anymore #16151

Closed
jumpapex opened this issue Aug 4, 2023 · 2 comments
Closed

q-tab click event handler has no 'go' argument anymore #16151

jumpapex opened this issue Aug 4, 2023 · 2 comments

Comments

@jumpapex
Copy link

jumpapex commented Aug 4, 2023

What happened?

we have used q-tabs, q-tab and q-tab-panels to implement something like property pages.
Also we handle q-tab @click event to do some validatation before switch tab panel.

e.g.
    async tab_clicked(e, go) {
      e.preventDefault()
      if (this.$refs.generalPage) {
        const generalDone = await this.$refs.generalPage.validate()
        if (generalDone) {
          go()
        }
        return
      }
    ...
  }

It works well with quasar 2.7.1, but not work with 2.12.3

Finally, I have found that version 2.12.3 has changed the logic, it just update the tab model anyway and will not call click with 'go' argument.

What did you expect to happen?

q-tab click event handler should not update the tab model if e.defaultPrevented is set to true and has 'go' argument.
or
is there any workaround for it(I don't want to use q-route-tab:))

Reproduction URL

https://codepen.io/tangram7/pen/PoxgRMO?editors=1011

How to reproduce?

From the URL,
click "MAIL" tab, should switch to it(but console log 'go' is undefined, and q-tabs switch the tab anyway).
click "ALARM" tab, should not switch to it.
click "MOVIES" tab, should switch to it(but console log 'go' is undefined, and q-tabs switch the tab anyway).

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

No response

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

Hi @jumpapex! 👋

It looks like you provided an invalid or unsupported reproduction URL.
Do not use any service other than Codepen, jsFiddle, StackBlitz, Codesandbox, and GitHub.
Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc.
Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏

@metalsadman
Copy link
Member

metalsadman commented Aug 13, 2023

in the docs @click event is only for QRouteTab, if you want to control navigation use QTabs :model-value="model" @update:model-value="handler" do your validation in the handler, and mutate your qtabs model accordingly.

@metalsadman metalsadman converted this issue into discussion #16186 Aug 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants