From 2b48f309ac686720d746071aab263b3969f899aa Mon Sep 17 00:00:00 2001 From: David Symonds Date: Sat, 16 Sep 2023 18:05:06 +1000 Subject: [PATCH] Set spellcheck=false attribute on silence filter . MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This hints to iOS Safari and other browsers that they shouldn't use spellcheck, but, more importantly, shouldn't use smart quotes (like “this” instead of "this"). This matters here because Alertmanager requires quotes for a filter but won't accept smart quotes, making it tedious since the default input keyboard will normally use them automatically. Signed-off-by: David Symonds --- ui/app/src/Views/FilterBar/Views.elm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/app/src/Views/FilterBar/Views.elm b/ui/app/src/Views/FilterBar/Views.elm index 9f19194ca5..f6133aa17d 100644 --- a/ui/app/src/Views/FilterBar/Views.elm +++ b/ui/app/src/Views/FilterBar/Views.elm @@ -1,7 +1,7 @@ module Views.FilterBar.Views exposing (view) import Html exposing (Html, a, button, div, i, input, small, span, text) -import Html.Attributes exposing (class, disabled, href, id, style, value) +import Html.Attributes exposing (class, disabled, href, id, spellcheck, style, value) import Html.Events exposing (onClick, onInput) import Utils.Filter exposing (Matcher, convertFilterMatcher) import Utils.Keyboard exposing (onKeyDown, onKeyUp) @@ -125,6 +125,8 @@ view { showSilenceButton } { matchers, matcherText, backspacePressed } = [ input [ id "filter-bar-matcher" , class "form-control" + -- Setting spellcheck=false on an input element will disable smartquotes in iOS. + , spellcheck False , value matcherText , onKeyDown keyDown , onKeyUp keyUp