-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add crosshairs, destroy globals, and tweak updates for code editor #17302
Conversation
34b2cc8
to
50e4768
Compare
When I press
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Another issue I found :
The code editor will not be loaded. There is cache on these tabs so we don't pass in the firstUpdated when going back to template dev. Maybe we should call |
Did that test work fine before this PR? Yeah I'm not sure about moving it to |
Yes it worked before this PR before code mirror wasn’t destroyed. |
Okay I moved the creation from |
I pushed another fix. As creation was async due to code mirror dynamic loading, code mirror instance can be created multiple time in Feel free to edit my changes if needed 😊 |
Seems overly complicated now with splitting everything up. Couldn't we just move the original this._loadedCodeMirror ||= await loadCodeMirror(); |
Yes maybe that could work. |
👍🏻 Also should handle the case of a quick disconnect (before the creation finishes). Working on that now. |
Okay I pushed something that I think better uses the lit API to accomplish what we want:
The type check failure is stemming from multiple |
@piitaya are you okay with the latest revision on this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems good to me ! 👍
Proposed change
A few unrelated tweaks I made while debugging and diagnosing #10458:
EditorView.destroy()
to clean up global listeners (may partially help Text is Reversed when typing in the Code Editor when Editing Lovelace Cards #10458 in some situations as some listen for selections)Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: