Skip to content
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

[info] Working with QBtn and QMenu #2

Open
GordonBlahut opened this issue Jul 5, 2019 · 0 comments
Open

[info] Working with QBtn and QMenu #2

GordonBlahut opened this issue Jul 5, 2019 · 0 comments
Labels

Comments

@GordonBlahut
Copy link

I posted in this discord but was recommended to start an issue here so it doesn't get lost.

If you want to have a QOverlay behind a QMenu that's a direct child of a QBtn, rather than wrapping the QOverlay around QMenu, keep it separate, and update the QOverlay's model from the QMenu's events.

Put the QOverlay outside of the QBtn (do not wrap it around QMenu).

<q-overlay v-model="overlay" z-index="5000">
    <template v-slot:body>
        <div class="fullscreen row justify-center items-center">
        </div>
    </template>
</q-overlay>

And use before-show and before-hide on the QMenu to set the QOverlay's model:

<q-btn
    icon="add"
    fab
> 
    <q-menu
       @before-show="overlay = true"
       @before-hide="overlay = false"
    >
        // ...
    </q-menu>
</q-btn>

That way the QMenu can remain a direct child of QBtn.

@hawkeye64 hawkeye64 changed the title Working with QBtn and QMenu [info] Working with QBtn and QMenu Dec 19, 2019
@hawkeye64 hawkeye64 pinned this issue Dec 19, 2019
@hawkeye64 hawkeye64 added question Further information is requested info and removed question Further information is requested labels Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants