vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Bug Report][3.6.3] ref behaviour changed

Open mlankamp opened this issue 1 year ago • 2 comments

Environment

Vuetify Version: 3.6.3 Last working version: 3.5.18 Vue Version: 3.4.26 Browsers: Edge 125.0.0.0 OS: Windows

Steps to reproduce

  • create a html element with a ref
  • in the onMounted check if the ref is set

Expected Behavior

The ref should be available in the onMounted

Actual Behavior

value is undefined

Reproduction Link

https://play.vuetifyjs.com/#...

mlankamp avatar May 02 '24 08:05 mlankamp

https://vuejs.org/api/composition-api-lifecycle.html#onmounted

A component is considered mounted after all of its synchronous child components have been mounted (does not include async components or components inside <Suspense> trees).

The only safe ways to do this are either to wait for the target element to be mounted: https://play.vuetifyjs.com/#eNpdj01ug0AMha9izSZECsMiUhcRSdsD9ASliwkx0Ujzp8HDBnH3eoAkKDv72X7v8+8o+thW3yHIIaE4iZrQBqMIL40DqIdShTCXj6a8qrgKW6kkTQYvETu4pvtnXb1PVo+XzsrT1yrtXqY3PQAbnRthVWgEfDHayfrkCG8saqfpZx5UG9enxRrBdV1tnuG2b6MOBD1SWn7SNvhIMOY0mKCL3sKOw3YLWutdT8AMcM4bxT6LXXItae9gxSj2MC4Ued0blMbfCz6SgzIJ55spsyzpnCumg0vGHMRRfsij+PsH9ZZ+Lg== or have a separate component that you can control the root element of: https://play.vuetifyjs.com/#eNqNUMtqwzAQ/JVFlzhgS4dAD8V26Qf4C+oeFEcJAr2QJUMx/vdKluKY5JKL2J2dGc3uz4xGO5BvY/DkGfpEtWPSCOpY2yuAeqqoMWt5b6oztRnYQ5XjTrDWsiuc/e2rJs+T7PHAA7L5SsrVw7T766gBspNs86wPdU12SUM7DpYbByNzPgXm0mjrIJldrZZwwCTUcdFD1CdF4KJyPUKevR7hwicIizU9ktT0aE327vczaNVprxy7lNEElpwlpYjMQavRQbCGJjKKYwQ3VVEcoWlhTseIXC0YFvpWBAWeqPBsFSzh3e+0lMoLUaIT/sAn9PsPddKflg==

KaelWD avatar May 02 '24 08:05 KaelWD

After updating to 3.6.3 I received the same error!

Tuhtarov avatar May 02 '24 09:05 Tuhtarov

It's because #15229, but the correct usage is what @KaelWD suggested, nothing is actionable in Vuetify level

yuwu9145 avatar May 03 '24 12:05 yuwu9145

@KaelWD How to know which vuetify components are asynchronous? About this commit 6a9d8e6

AndyBeat avatar May 15 '24 08:05 AndyBeat

Best to just assume everything is.

KaelWD avatar May 15 '24 08:05 KaelWD