summaryrefslogtreecommitdiff
path: root/addons/web/static/src/scss
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2021-03-03 14:53:54 +0000
committerGéry Debongnie <ged@odoo.com>2021-03-03 15:39:41 +0000
commit580456b6ab36d16195eae9ffd776ff245ecd936e (patch)
tree4dc4d70c9ebf432d67c7b9d4b8545cd144603c51 /addons/web/static/src/scss
parentaa5eaf69380ca3c5b9ed1b5dcb183e90fdc9303a (diff)
[FIX] web: prevent traceback when pressing TAB in color_picker widget
The color_picker widget, that can be seen for example in the track form view for event tracks, had an issue: if the user clicked on it, then pressed TAB, a traceback was displayed. The problem comes from the fact that the color picker widget inherits from FieldInput, but is not a fieldinput, so many expectations made by the FieldInput code do not hold, such as the code run when handling navigation (by TAB and such keypress). Because of that, the code in _onNavigationMove crashed, because it expected an input. Since this is a bug fix, I simply disabled the navigation in that case, so no crash happens. Sadly, this widget has still a big issue: it clearly does not work as most users would expect: pressing TAB or arrows should update the selection. But this would be a more complicated refactoring, for a bug which is clearly not critical, therefore this commit implements the simple and safe solution. Also, we disable the focus outline to minimize the wrong expectation. Seeing them kind of implied that one could update the selection with the keyboard. Note that the widget color_picker was moved from another addon to web/, without any tests nor documentation. OPW 2467369 closes odoo/odoo#67174 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/scss')
-rw-r--r--addons/web/static/src/scss/color_picker.scss3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/scss/color_picker.scss b/addons/web/static/src/scss/color_picker.scss
index 304563f7d90..18eb7aea841 100644
--- a/addons/web/static/src/scss/color_picker.scss
+++ b/addons/web/static/src/scss/color_picker.scss
@@ -15,6 +15,9 @@
> li {
border: 2px solid white;
box-shadow: 0 0 0 1px gray('300');
+ > a:focus {
+ outline: none;
+ }
}
}
}