[ui] Put error message in omnibox attrs, not in the selector.
Error messages posted to the omnibox that contain a closing square
brace ']' broke mithril as the message was injected un-escaped into
the selector.
This change moves the error message into the attrs rather than
injecting it into the selector which avoids the need to escape it.
Bug: 310727957
Change-Id: I0d2cb1ef7e788777c28c6863d27c7edd3551d215
diff --git a/ui/src/frontend/app.ts b/ui/src/frontend/app.ts
index 500db72..025d5ff 100644
--- a/ui/src/frontend/app.ts
+++ b/ui/src/frontend/app.ts
@@ -408,12 +408,10 @@
if (msgTTL > 0 || engineIsBusy) {
setTimeout(() => raf.scheduleFullRedraw(), msgTTL * 1000);
return m(
- `.omnibox.message-mode`,
- m(`input[placeholder=${
- globals.state.status.msg}][readonly][disabled][ref=omnibox]`,
- {
- value: '',
- }));
+ `.omnibox.message-mode`, m(`input[readonly][disabled][ref=omnibox]`, {
+ value: '',
+ placeholder: globals.state.status.msg,
+ }));
}
if (this.omniboxMode === OmniboxMode.Command) {