react-resizable-panels icon indicating copy to clipboard operation
react-resizable-panels copied to clipboard

Enter key operation does not trigger onExpand or onCollapse events

Open ysds opened this issue 2 months ago • 0 comments

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.

ysds avatar Oct 20 '25 12:10 ysds