From 35e88a332a14a80fef83551020f40f87ef0a1821 Mon Sep 17 00:00:00 2001 From: Lucas Perais Date: Wed, 5 Oct 2022 13:06:33 +0000 Subject: [PATCH] [FIX] web: phone,email,selection fields show helpers on hover Only on devices not handling touch. Before this commit, the phone, email, and selection fields always displayed their field as in edit mode, even if not hovered. eg. The envelope button of the email field, the SMS and call button of the phone field and the caret of the selection field where always visible. Since the form is always in edition, it doesn't make sense to always display those elements. This commit makes those element display only on hover and on focus. closes odoo/odoo#102489 X-original-commit: f87aa36f42fc190285241aeb8e1a4d9ab1644989 Signed-off-by: Lucas Perais (lpe) --- .../web/static/src/views/fields/fields.scss | 20 +++++++++++++++++++ .../fields/selection/selection_field.xml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/views/fields/fields.scss b/addons/web/static/src/views/fields/fields.scss index 92da2877df4..3f08228f97c 100644 --- a/addons/web/static/src/views/fields/fields.scss +++ b/addons/web/static/src/views/fields/fields.scss @@ -48,3 +48,23 @@ .o_kanban_quick_create .o_field_widget .o_input { border-color: var(--o-input-border-color); } + +body:not(.o_touch_device) .o_field_widget { + // Phone, Email + &.o_field_phone, &.o_field_email { + &:not(:hover):not(:focus-within) { + & input:not(:hover) ~ a { + display: none !important; + } + } + } + + // Selection + &.o_field_selection { + &:not(:hover):not(:focus-within) { + & select:not(:hover) { + background: none !important; + } + } + } +} diff --git a/addons/web/static/src/views/fields/selection/selection_field.xml b/addons/web/static/src/views/fields/selection/selection_field.xml index 13e639fc1f2..b572bab8f9e 100644 --- a/addons/web/static/src/views/fields/selection/selection_field.xml +++ b/addons/web/static/src/views/fields/selection/selection_field.xml @@ -6,7 +6,7 @@ -