Provide uniform/standard/documented way of accessing the outer/inner elements of QDialog/QMenu/QTooltip
See original GitHub issueWhat happened?
I have a custom component that wraps QMenu, e.g.:
<template>
<q-menu ref="menuRef" @show="onShow">
... content ...
</q-menu>
</template>
<script setup>
const menuRef = ref(null)
function onShow () {
console.log('onShow', menuRef.value.$el)
}
</script>
The problem is - upon showing the menu, the menuRef.value.$el
is resolved to #text
and not to the actual menu element - please see the codepen below.
What did you expect to happen?
As explained in this thread - https://github.com/quasarframework/quasar/issues/13628 - refs are resolved after @show()
- and indeed, I have a QDialog which works OK, but it seems this is not working for QMenu.
Reproduction URL
https://codepen.io/ddenev/pen/BaVaQLx
How to reproduce?
- Go to the repro link
- Click on the button
- Check the console output - it shows that menuRef.value.$el is text and not the menu element
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar), SPA Mode
Platforms/Browsers
Chrome
Quasar info output
No response
Relevant log output
No response
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
[QUESTION] Stream staleness and connection resets - IssueHint
We have an edge device streaming on device frames into KVS, the frames are received reliably and sent to the cloud.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do not use internal variables. It will work until it won’t. Will provide a uniform way of accessing the actual content for all portal-based components.
It’s not a bug, just a different way the components are created/used. I’ll reopen this, but please change the title to something like
Provide uniform/standard/documented way of accessing the outer/inner elements of QDialog/QMenu/QTooltip