-
-
Notifications
You must be signed in to change notification settings - Fork 381
Closed
Description
Describe the bug
I've had people report that in our web application (Trilium Notes), the space key would not work at all (to enter a note title, to type text, etc.).
After investigation, it turns out the problem comes from Mind Elixir, more specifically there appears to be an event handler that consumes the space bar globally.
const handleKeyDown = (e: KeyboardEvent) => {
if (e.code === 'Space') {
mind.spacePressed = true
mind.container.classList.add('space-pressed')
e.preventDefault() // 防止页面滚动
}
}
{ dom: document, evt: 'keydown', func: handleKeyDown },
The regression came from fb9ef30, which was released starting with 5.2.1.
To Reproduce
Steps to reproduce the behavior:
- Render a mind map alongside a text box.
- Focus the textbox and type words with spaces.
- Notice how the space doesn't work anymore.
Expected behavior
The space bar should work fine.
Metadata
Metadata
Assignees
Labels
No labels