You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click on the working checkbox. The v-model value updates and the "updated" lifecycle event fires a console log.
Click on the "busted" checkbox, which is the same markup as the working checkbox, but wrapped within a div inside the DynamicWrap component.
Notice that the checkbox appears checked, but the v-model doesn't update and the "updated" lifecycle event of the checkbox never fires.
What is expected?
The second checkbox's v-model updates correctly
What is actually happening?
No updated lifecycle event fires, the v-model is not updated.
What's happening:
The DynamicWrapper is rerendered after mount when the UnwrappedCheckbox is created inside of its default slot. UnwrappedCheckbox uses provide/inject to update the DynamicWrap component to wrap it with a 'div' instead of a 'label' element. This clones the content inside, but once the Checkbox is nested a layer deeper, it stops behaving as expected.
Sorry for the monster title and complex replication, let me know if there's anything more I can do to clarify. For context, the purpose of this DynamicWrapper is to act as a type of "FormItem" component. It wraps any element placed inside of the component (In this case a Checkbox) with a label element unless it's something like a Checkbox or Radio. We have our own Checkbox and Radio, that we'd like to tell the FormItem to unwrap the label if a Checkbox is placed inside it.
I've also tested in the beta prerelease and the issue remains.
Version
2.5.16
Reproduction link
https://jsfiddle.net/linnea/zmkt7ajy/15/
Steps to reproduce
Notice that the checkbox appears checked, but the v-model doesn't update and the "updated" lifecycle event of the checkbox never fires.
What is expected?
The second checkbox's v-model updates correctly
What is actually happening?
No updated lifecycle event fires, the v-model is not updated.
What's happening:
The DynamicWrapper is rerendered after mount when the UnwrappedCheckbox is created inside of its default slot. UnwrappedCheckbox uses provide/inject to update the DynamicWrap component to wrap it with a 'div' instead of a 'label' element. This clones the content inside, but once the Checkbox is nested a layer deeper, it stops behaving as expected.
Sorry for the monster title and complex replication, let me know if there's anything more I can do to clarify. For context, the purpose of this DynamicWrapper is to act as a type of "FormItem" component. It wraps any element placed inside of the component (In this case a Checkbox) with a label element unless it's something like a Checkbox or Radio. We have our own Checkbox and Radio, that we'd like to tell the FormItem to unwrap the label if a Checkbox is placed inside it.
I've also tested in the beta prerelease and the issue remains.
Possible related previous issues:
#6372
#6915
The text was updated successfully, but these errors were encountered: