Skip to content

Commit 121043d

Browse files
committed
fix: issue with context menu divider item stealing the event from previous item
1 parent 0315cb3 commit 121043d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/gui/src/UI/UIContextMenu.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ function UIContextMenu(options){
501501
}
502502
// divider
503503
else if(options.items[i].is_divider || options.items[i] === '-')
504-
h += `<li class="context-menu-divider"><hr></li>`;
504+
h += `<li class="context-menu-item context-menu-divider"><hr></li>`;
505505
}
506506
h += `</div>`
507507
$('body').append(h)

src/gui/src/css/style.css

+8-5
Original file line numberDiff line numberDiff line change
@@ -1561,13 +1561,17 @@ span.header-sort-icon img {
15611561
}
15621562

15631563
.context-menu .context-menu-divider>hr {
1564-
margin-top: 5px;
1565-
margin-bottom: 5px;
1564+
margin-top: 0;
1565+
margin-bottom: 0;
15661566
border-bottom: none;
15671567
border-top: 1px solid #00000033;
15681568
}
1569+
.context-menu .context-menu-divider{
1570+
padding-top: 5px;
1571+
padding-bottom: 5px;
1572+
}
15691573

1570-
.context-menu .context-menu-item {
1574+
.context-menu .context-menu-item:not(.context-menu-divider) {
15711575
padding: 5px;
15721576
list-style-type: none;
15731577
user-select: none;
@@ -1623,7 +1627,7 @@ span.header-sort-icon img {
16231627
background-color: #dfdfdf;
16241628
}
16251629

1626-
.context-menu .context-menu-item-active {
1630+
.context-menu .context-menu-item-active:not(.context-menu-divider) {
16271631
background-color: var(--select-color);
16281632
color: white;
16291633
}
@@ -1632,7 +1636,6 @@ span.header-sort-icon img {
16321636
background-color: rgb(199, 205, 212);
16331637
color: initial;
16341638
border-radius: 4px;
1635-
16361639
}
16371640

16381641
.context-menu .context-menu-item-disabled, .context-menu .context-menu-item-disabled:hover {

0 commit comments

Comments
 (0)