mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Enhance context menu scrolling behavior (#414)
This commit is contained in:
@@ -24,6 +24,16 @@
|
|||||||
box-shadow: 0 0 10px black !important;
|
box-shadow: 0 0 10px black !important;
|
||||||
background-color: #2e2e2e !important;
|
background-color: #2e2e2e !important;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
max-height: -webkit-fill-available;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Enable scrolling overflow in Firefox */
|
||||||
|
@supports not (max-height: -webkit-fill-available) {
|
||||||
|
.litegraph.litecontextmenu {
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.litegraph.litecontextmenu.dark {
|
.litegraph.litecontextmenu.dark {
|
||||||
|
|||||||
@@ -115,19 +115,6 @@ export class ContextMenu {
|
|||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
|
|
||||||
function on_mouse_wheel(e: WheelEvent) {
|
|
||||||
const pos = parseInt(root.style.top)
|
|
||||||
root.style.top = (pos + e.deltaY * options.scroll_speed).toFixed() + "px"
|
|
||||||
e.preventDefault()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!options.scroll_speed) {
|
|
||||||
options.scroll_speed = 0.1
|
|
||||||
}
|
|
||||||
|
|
||||||
root.addEventListener("wheel", on_mouse_wheel, true)
|
|
||||||
|
|
||||||
this.root = root
|
this.root = root
|
||||||
|
|
||||||
// title
|
// title
|
||||||
|
|||||||
@@ -269,6 +269,7 @@ export interface IContextMenuOptions extends IContextMenuBase {
|
|||||||
parentMenu?: ContextMenu
|
parentMenu?: ContextMenu
|
||||||
event?: MouseEvent
|
event?: MouseEvent
|
||||||
extra?: unknown
|
extra?: unknown
|
||||||
|
/** @deprecated Context menu scrolling is now controlled by the browser */
|
||||||
scroll_speed?: number
|
scroll_speed?: number
|
||||||
left?: number
|
left?: number
|
||||||
top?: number
|
top?: number
|
||||||
|
|||||||
Reference in New Issue
Block a user