fix: 消除 UltraplanChoiceDialog 中的 wheelDown/wheelUp as any
Ink Key 类型已包含 wheelDown/wheelUp 属性,直接访问即可。
This commit is contained in:
parent
da10c45e76
commit
2044858b9f
|
|
@ -87,11 +87,11 @@ export function UltraplanChoiceDialog({
|
||||||
if (!isScrollable) return;
|
if (!isScrollable) return;
|
||||||
const halfPage = Math.max(1, Math.floor(visibleHeight / 2));
|
const halfPage = Math.max(1, Math.floor(visibleHeight / 2));
|
||||||
|
|
||||||
if ((key.ctrl && input === 'd') || (key as any).wheelDown) {
|
if ((key.ctrl && input === 'd') || key.wheelDown) {
|
||||||
const step = (key as any).wheelDown ? 3 : halfPage;
|
const step = key.wheelDown ? 3 : halfPage;
|
||||||
setScrollOffset(prev => Math.min(prev + step, maxOffset));
|
setScrollOffset(prev => Math.min(prev + step, maxOffset));
|
||||||
} else if ((key.ctrl && input === 'u') || (key as any).wheelUp) {
|
} else if ((key.ctrl && input === 'u') || key.wheelUp) {
|
||||||
const step = (key as any).wheelUp ? 3 : halfPage;
|
const step = key.wheelUp ? 3 : halfPage;
|
||||||
setScrollOffset(prev => Math.max(prev - step, 0));
|
setScrollOffset(prev => Math.max(prev - step, 0));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user