frontend
frontend copied to clipboard
Automation Editor, Script Editor and Template Editor Issues
Checklist
- [X] I have updated to the latest available Home Assistant version.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
Describe the issue you are experiencing
The automation editor, script Editor and Template Editor has a problem. On the forums I create a post and the android developer stated he believed it may be a frontend issue.
Home Assistant Forum Post Per the post someone with the same exact phone is experiencing similar issues.
It will start to create 2 lines by pressing return on the keyboard. It will double space when pressing the spacebar sometimes. At times when highlighting code for deletion or pasting and either clicking delete or paste it will make what seems to be at least 3 times the code rather than doing what it should.
Example.
{{ foo }}
Will become
{{ foo }}{{ foo }}{{ foo }}{{ foo }}{{ foo }}{{ foo }}{{ foo }} when trying to paste over it or delete it.
I’m on Android 12 Galaxy s22 Ultra. Home Assistant runs without issues.
Describe the behavior you expected
I expected it to drop 1 line when pressing enter. A real 1 line not appear as 2 or truly drop 2. Delete or replace whatever is selected not replicate it 30 times.

Steps to reproduce the issue
- Android 12 Galaxy s22
- Automation editor, script Editor or template editor
- Press return on keyboard and it will double create a line below or stretch a line into what appears to be 2
- Attempt to replace or delete highlighted code and not all the time but sometimes it will replicate the code instead or delete 1 letter from the end as if it was never highlighted.
- Sometimes when attempting to use the spacebar it will double space code when it should be single spacing. ...
What version of Home Assistant Core has the issue?
2022.6.3
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Android Latest Version
Which operating system are you using to run this browser?
Android 12
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response
I'm seeing this exact same behaviour on my Samasung S22 Plus running Android 12. I have also managed to recreate the extended/stretched line using the latest Chrome browser on my phone too, when editing the yaml of an automation, and typing two curly brackets followed by the return key on the on-screen keyboard.

So it seems to be a frontend issue that spans both the HA companion app as well as android Web browser (Chrome at least). I will check other android browsers for the behaviour and confirm.
This is only an issue on Android? You can't reproduce it in Chrome on a desktop?
This is only an issue on Android? You can't reproduce it in Chrome on a desktop?
Only an issue on android for chrome and the companion app. Unable to reproduce on desktop chrome.
This is only an issue on Android? You can't reproduce it in Chrome on a desktop?
Here's another example in the companion app. I tried to type something and then go back with the x button and this happened. I couldn't delete that without highlighting it otherwise it just kept generating more. Sometimes even highlighting doesn't work I just have to close out and reopen.

I've also found in the Terminal and SSH addon, typing a # symbol results in 2 # symbols being inserted

This is only an issue on Android? You can't reproduce it in Chrome on a desktop?
Any luck on finding the cause of our issues?
I noticed this issue occurs in the card editor as well. Not sure if this will help but I am going to try turning on remote web vide debugging and getting the logs if possible to paste here when the issue is recreated.
Still happening on 2022.9.1
Same problem on my S21, Android 12, Home Assistant 2022.10.5 and Companion App 2022.10.1
Still happening for me as well @bramkragten
Latest stable android companion app Latest stable home assistant release.
Happening with 2 different home assistant instances. (I also have companion app minimal).
I submitted a change to upgrade CodeMirror to the latest version (#14969). Some of the bug fixes may solve or improve this issue. This will probably go into 2023.2, but if anyone can test that branch ahead of time, it would certainly be useful.
I submitted a change to upgrade CodeMirror to the latest version (#14969). Some of the bug fixes may solve or improve this issue. This will probably go into 2023.2, but if anyone can test that branch ahead of time, it would certainly be useful.
You're a legend if this fixes the issue. This seems to happen across a lot of code editors. Including portainer for example.
Agreed! This issue has seemingly become worse of late, with the most recent HA updates. Opening any editor from within the HA Android app, and placing the cursor anywhere, starts adding new line after new line endlessly to the bottom of the code, every second or so. It's become totally unusable so any improvement would be welcome!
To be clear, that change just upgrades the CodeMirror packages used in HA, so nothing legendary. 🦸🏻♂️
But the fact that it occurs for you outside HA points to a bug in CodeMirror as the problem. For example, Portainer looks to use an older version of CodeMirror as well.
There are a couple android-specific fixes mentioned in their changelog which sort of sound like they might solve this, but I do not have HA on android to test.
To be clear, that change just upgrades the CodeMirror packages used in HA, so nothing legendary. 🦸🏻♂️
But the fact that it occurs for you outside HA points to a bug in CodeMirror as the problem. For example, Portainer looks to use an older version of CodeMirror as well.
There are a couple android-specific fixes mentioned in their changelog which sort of sound like they might solve this, but I do not have HA on android to test.
I wouldn't say all the issues are fixed by this (I'm on 2023.2) but it definitely seems better which is better than nothing.
You are running the dev branch? What's better and what isn't? Need specifics, preferably repeatable, to diagnose and fix anything.
You are running the dev branch? What's better and what isn't? Need specifics, preferably repeatable, to diagnose and fix anything.
Oops 2022.1.2 not dev. I will try messing with it to see what's better.
Reminder: If you're a beta tester, please look to see if this is resolved.
Were there more changes that may help with this issue?
I'm going to be deploying the beta soon.
Just the upgrade to CodeMirror
Just the upgrade to CodeMirror
I'm running the beta and the improvement is already noticeable. I'll keep this open while I test but things are looking good thank you.
@steverep thank you. I never thought this issue would get fixed as it was an issue since May/June. Thank you for finding the culprit and pushing an update.