- Issue created by @hooroomoo
- 🇺🇸United States hooroomoo
I think it makes sense to do this after 🐛 Auto-save changes from code editor get lost if you navigate out too quickly Active which will hopefully get in soon.
There is a @todo in there that points to this issue to add checking for props/slots changes and block navigation until that's been auto-saved.
- 🇺🇸United States hooroomoo
- 🇮🇳India meghasharma
I’m able to reproduce the issue — when I update props or slots under the Component Data tab without making any changes in the JS or CSS tabs, the updates are not auto-saved.
- 🇮🇳India meghasharma
I’d like to start working on a fix, but I couldn’t locate the file where the auto-save logic should be added for props or slots updates. Could you please point me to the right place to make this change? Thank you!
- 🇺🇸United States hooroomoo
Hi @meghasharma, the todo is under the proposed resolution in the second bullet, but I can see how that could be easy to miss.
if you do a search for this issue number "3525907" in the codebase, there is a todo inside of
/ui/src/features/code-editor/hooks/useSourceCode.ts
which is where the change should be made. - 🇮🇳India meghasharma
Hi @hooroomoo,
Thanks for the info. I tried the following in useSourceCode.ts:
Added deep comparison for props and slots using lodash/isEqual.
Updated refs to track changes in props and slots.
Triggered auto-save when props, slots, or source code change.
Verified dispatching compiled JS and CSS updates.But the issue with auto-save losing changes on quick navigation still happens.