From fec08ecdb848ef5acf1f327f275c426b63c847b5 Mon Sep 17 00:00:00 2001 From: daria Date: Thu, 8 Feb 2024 16:31:07 +0200 Subject: [PATCH 1/5] separate hover and focus styling on menu items --- customize.dist/src/less2/include/dropdown.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/customize.dist/src/less2/include/dropdown.less b/customize.dist/src/less2/include/dropdown.less index d5ed0955a..5c99c49ec 100644 --- a/customize.dist/src/less2/include/dropdown.less +++ b/customize.dist/src/less2/include/dropdown.less @@ -139,8 +139,10 @@ } li[role="menuitem"] { border-radius: @variables_radius; - &:hover, &:focus { + &:hover{ background-color: @cp_dropdown-bg-hover !important; + } + &:focus { color: @cp_dropdown-fg; } } From a7a0e0346c613c4137fc09dbb734c68d1166d4c6 Mon Sep 17 00:00:00 2001 From: daria Date: Mon, 19 Feb 2024 15:05:32 +0200 Subject: [PATCH 2/5] fix hover and focus styling on menu items --- www/common/common-ui-elements.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 65f28c0c6..d346de0dc 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1590,7 +1590,6 @@ define([ $li.on('mouseenter', (e) => { e.stopPropagation(); - $li.focus(); }); var onAction = function (e) { if (config.isSelect) { return; } @@ -1692,6 +1691,10 @@ define([ show(); }); + $innerblock.on('mouseover', function() { + $(document.activeElement).blur(); + }); + if (config.isSelect) { $container.onChange = Util.mkEvent(); $container.on('click', 'li', function () { From f032b22946879cd3e48f1e588535629d269ac9ee Mon Sep 17 00:00:00 2001 From: David Benque Date: Fri, 23 Feb 2024 13:51:59 +0000 Subject: [PATCH 3/5] Small focus fixes - Use :focus-visible selector - Apply FG color inside dropdown --- customize.dist/src/less2/include/dropdown.less | 4 ++-- customize.dist/src/less2/include/toolbar.less | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/customize.dist/src/less2/include/dropdown.less b/customize.dist/src/less2/include/dropdown.less index 5c99c49ec..23285e6c6 100644 --- a/customize.dist/src/less2/include/dropdown.less +++ b/customize.dist/src/less2/include/dropdown.less @@ -142,8 +142,8 @@ &:hover{ background-color: @cp_dropdown-bg-hover !important; } - &:focus { - color: @cp_dropdown-fg; + &:focus-visible { + outline-color: @cp_dropdown-fg; } } &> span { diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 12c3736fc..6e080e92a 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -366,7 +366,7 @@ .cp-toolbar { * { outline-style: none; - &:focus { + &:focus-visible { outline: @cryptpad_color_brand solid 2px; } } From 49128e3c8c1a25ae2b51a1765990794a4f2fce48 Mon Sep 17 00:00:00 2001 From: daria Date: Wed, 20 Mar 2024 13:04:47 +0200 Subject: [PATCH 4/5] change size of submenus --- customize.dist/src/less2/include/dropdown.less | 4 ++++ www/common/common-ui-elements.js | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/customize.dist/src/less2/include/dropdown.less b/customize.dist/src/less2/include/dropdown.less index 2bd133d46..7917f99ee 100644 --- a/customize.dist/src/less2/include/dropdown.less +++ b/customize.dist/src/less2/include/dropdown.less @@ -98,6 +98,10 @@ &.cp-dropdown-submenu { left: 250px; + top: 130px; + } + + &.cp-dropdown-submenu:nth-last-of-type(1){ top: 100px; } diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 2cc3faf24..34c986cbc 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1690,8 +1690,7 @@ define([ $innerblock.css('bottom', button.height+'px'); } } else if ($parentMenu) { - let max = $parentMenu.css('max-height'); - $innerblock.css('max-height', max); + $innerblock.css('max-height', Math.floor(wh - topPos - 400)+'px'); } else { $innerblock.css('max-height', Math.floor(wh - topPos - 1)+'px'); } From 5df81b4558e951d0eb1012c20ea7671bacdebce1 Mon Sep 17 00:00:00 2001 From: daria Date: Thu, 21 Mar 2024 11:36:27 +0200 Subject: [PATCH 5/5] Revert "change size of submenus" This reverts commit 49128e3c8c1a25ae2b51a1765990794a4f2fce48. --- customize.dist/src/less2/include/dropdown.less | 4 ---- www/common/common-ui-elements.js | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/customize.dist/src/less2/include/dropdown.less b/customize.dist/src/less2/include/dropdown.less index 7917f99ee..2bd133d46 100644 --- a/customize.dist/src/less2/include/dropdown.less +++ b/customize.dist/src/less2/include/dropdown.less @@ -98,10 +98,6 @@ &.cp-dropdown-submenu { left: 250px; - top: 130px; - } - - &.cp-dropdown-submenu:nth-last-of-type(1){ top: 100px; } diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 34c986cbc..2cc3faf24 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1690,7 +1690,8 @@ define([ $innerblock.css('bottom', button.height+'px'); } } else if ($parentMenu) { - $innerblock.css('max-height', Math.floor(wh - topPos - 400)+'px'); + let max = $parentMenu.css('max-height'); + $innerblock.css('max-height', max); } else { $innerblock.css('max-height', Math.floor(wh - topPos - 1)+'px'); }