mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
fix(webui): fix arrow key frame rounding and duplicate event bubbling
- Use Math.round instead of Math.floor for keyboard arrow frame navigation in ModelViewer - Add e.stopPropagation() to RulerSlider keyboard events to prevent duplicate bubbling to window listener
This commit is contained in:
@@ -85,15 +85,19 @@ export const RulerSlider: React.FC<RulerSliderProps> = ({
|
||||
if (disabled) return
|
||||
if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
onChange((((normalizedDegree - STEP) % 360) + 360) % 360)
|
||||
} else if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
onChange((normalizedDegree + STEP) % 360)
|
||||
} else if (e.key === 'Home') {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
onChange(0)
|
||||
} else if (e.key === 'End') {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
onChange(345)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user