Skip to content

[Enhancement] Restore Keyboard Focus to Chat Input After Closing Keyboard Shortcuts Modal #821

Open

Description

@kareena0229

Is your feature request related to a problem? Please describe.

Currently, when the Keyboard Shortcuts help modal is closed (either by clicking the close button, clicking outside the modal, or pressing Esc), the keyboard focus is not returned to the chat input. Keyboard users need to manually click the input field before they can continue typing.

Describe the solution you'd like

After the shortcuts modal is closed, automatically restore focus to the chat input using the existing textareaRef.

Example:

textareaRef.current?.focus();

This should work regardless of how the modal is dismissed:

  • Close button
  • Clicking outside the modal
  • Pressing Esc

Benefits

  • Improves keyboard accessibility.
  • Creates a smoother chat experience.
  • Lets users continue typing immediately after closing the modal.
  • Follows common accessibility and focus management practices.

Describe alternatives you've considered

Users can manually click the chat input after closing the modal, but this adds unnecessary interaction and interrupts keyboard-based workflows.

Affected File

frontend/src/components/chat/ChatPanel.tsx

Additional Context

This change is small, backward-compatible, and only improves focus management without affecting existing chat functionality.

Activity

  1. github-actions commented on Jul 9, 2026

    @github-actions

    Hi @kareena0229! 👋

    Thanks for opening this issue! We are thrilled to have you contribute to PDF-Assistant-RAG for GSSoC 2026.

    📌 Before you start:

    • Make sure you have read our Contributing Guidelines.
    • Wait for a project admin to assign this issue to you before working on it.
    • Remember to branch off dev and not main.

    Happy Coding! 🚀

  2. kareena0229 commented on Jul 9, 2026

    @kareena0229
    ContributorAuthor

    /assign GSSoC

    I would like to work on this issue assign it to me. @param20h

  3. changed the title [-][Enhancement] Close Export Menu After Successful Export[/-] [+][Enhancement] Restore Keyboard Focus to Chat Input After Closing Keyboard Shortcuts Modal[/+] on Jul 9, 2026
  4. kareena0229 commented on Jul 9, 2026

    @kareena0229
    ContributorAuthor

    PR #823 supposed to close this issue @param20h do Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvementgssocGirlScript Summer of Code 2026 issue/PR

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions