Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why can't ArrowUp, ArrowDown, and Backspace trigger in keyboard events #1950

Open
zhengdechang opened this issue Jun 16, 2024 · 0 comments
Open

Comments

@zhengdechang
Copy link

zhengdechang commented Jun 16, 2024

Problem

Detail the problem here, including any possible solutions.

Sample code to reproduce your issue

  const latexRef = useRef(null);

 useEffect(() => {
        const editor = editorRef.current.editor;
        editor.session.selection.on('changeCursor', handleCursorChange);
        editor.container.addEventListener('keydown', handleKeyDown);

        return () => {
            editor.session.selection.off('changeCursor', handleCursorChange);
            editor.container.removeEventListener('keydown', handleKeyDown);
        };
    }, []);
    
    const handleKeyDown = (event) => {
            console.log(event.key, 'event.key')
    }

 <AceEditor
        mode="latex"
        name="aceEditor"
        height="100%"
        width="100%"
        fontSize="16px"
        editorProps={{ $blockScrolling: true }}
                ref={latexRef}
      ></AceEditor>

References

Progress on: #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant