From 6bacd1d663d5980bed64ebc77214aeb95e413ee7 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Mon, 27 May 2024 11:13:05 +0200 Subject: [PATCH] Disable password manager completion --- .../app/main/ui/workspace/tokens/common.cljs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/common.cljs b/frontend/src/app/main/ui/workspace/tokens/common.cljs index 19b409f36..866f8e660 100644 --- a/frontend/src/app/main/ui/workspace/tokens/common.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/common.cljs @@ -24,10 +24,16 @@ (mf/defc labeled-input {::mf/wrap-props false} - [{:keys [input-ref label default-value on-change auto-focus?]}] - [:label {:class (stl/css :labeled-input)} - [:span {:class (stl/css :label)} label] - [:input {:ref input-ref - :default-value default-value - :autoFocus auto-focus? - :on-change on-change}]]) \ No newline at end of file + [{:keys [input-ref label default-value on-change auto-focus? auto-complete?]}] + (let [input-props (cond-> {:ref input-ref + :default-value default-value + :autoFocus auto-focus? + :on-change on-change} + ;; Disable auto-complete on form fields for proprietary password managers + ;; https://github.com/orgs/tokens-studio/projects/69/views/11?pane=issue&itemId=63724204 + (not auto-complete?) (assoc :data-1p-ignore true + :data-lpignore true + :autoComplete "off"))] + [:label {:class (stl/css :labeled-input)} + [:span {:class (stl/css :label)} label] + [:& :input input-props]]))