Fix v-safe-html directive unbind issue
What does this MR do and why?
When I was helping review !157627 (merged) I noticed a weird issue with our v-safe-html
directive. It is also an existing bug when deleting a group from Settings
-> General
-> Advanced
After a fair bit of debugging I figured out that in some cases binding.oldValue
is not being reset in the unbind
event. This means that when the bind
event is called the element content is not updated because we first do if (binding.oldValue !== binding.value)
. This seems like a Vue bug but weirdly I couldn't find any open issues about it
To fix this bug we can explicitly delete binding.oldValue
in the unbind
event.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Before | After |
---|---|
Screen_Recording_2024-06-27_at_1.00.03_PM | Screen_Recording_2024-06-27_at_12.59.41_PM |
How to set up and validate locally
- Go to a group -> Settings -> General -> Advanced
- Click
Delete group
button. If you have delayed group deletion setup you will need to go delete the group again. - Close the modal, and reopen 3 times.