Skip to content

Enter key operation does not trigger onExpand or onCollapse events #522

@ysds

Description

@ysds

When using the Enter key on a PanelResizeHandle to expand/collapse panels following the Window Splitter Pattern, the onExpand, onCollapse, and onResize callbacks are not triggered.

While a workaround can be implemented using onKeyDown, this behavior seems inconsistent since Home and End key operations correctly trigger these events.

Could you consider making the Enter key trigger these events for consistency?

Steps to reproduce:

demo: https://codesandbox.io/p/devbox/react-resizable-panels-forked-rp3v4l

  1. Create a PanelResizeHandle with onExpand, onCollapse, or onResize callbacks
  2. Focus on the resize handle
  3. Press Enter key to expand/collapse the panel
  4. Observe that the callbacks are not triggered

Expected behavior:
Enter key operations should trigger onExpand, onCollapse, and onResize events, similar to Home and End key behavior.

Actual behavior:
Enter key operations do not trigger these callback events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions