fix: row height / column width value not applied when pressing Enter in context menu - #765
Open
bynkook wants to merge 1 commit into
Open
Conversation
The set-row-height and set-column-width inputs called e.stopPropagation() unconditionally on keydown, which prevented the Enter key from bubbling up to the parent Menu's onClick handler. As a result, the value typed in the input was never applied unless the user clicked one of the adjacent text labels — a completely unintuitive interaction. Fix: allow Enter to programmatically trigger a click on the nearest .luckysheet-cols-menuitem element, which invokes the existing Menu onClick logic that reads the input value and calls api.setRowHeight / api.setColumnWidth.
bynkook
added a commit
to bynkook/ht_tools
that referenced
this pull request
Apr 16, 2026
컨텍스트 메뉴의 행 높이(set-row-height) 및 열 너비(set-column-width) 입력 필드에서 onKeyDown이 e.stopPropagation()만 호출하여 Enter 키가 부모 Menu의 onClick에 도달하지 않는 버그 수정. 수정 방법: Enter 키 입력 시 가장 가까운 .luckysheet-cols-menuitem 요소를 programmatic click하여 기존 값 적용 로직이 실행되도록 처리. - patch-package로 관리 (npm install 시 자동 적용) - FortuneSheet 원소스에도 동일 수정으로 PR 등록 완료 ruilisi/fortune-sheet#765 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Fix row height / column width input not applying value on Enter key
Summary
In the context menu, the "Set row height" and "Set column width" inputs stop
propagation of all
keydownevents. This means pressing Enter after typinga value (or adjusting with the spinner) never triggers the parent
Menu'sonClickhandler, so the value is never applied.The only way the value was ever applied was by clicking the plain-text label
next to the input (e.g. the "row", "height", "column", "width", or "px"
text nodes) — a hidden and completely unintuitive interaction that most
users will never discover.
Reproduction
set-row-height).50) and press Enter.Same steps apply to "Set column width" (
set-column-width).Root Cause
packages/react/src/components/ContextMenu/index.tsxThe
Menuwrapper component relies on its ownonClickto read the inputvalue and call
api.setRowHeight/api.setColumnWidth:Because
stopPropagation()is called unconditionally, the Enter key neverbubbles up to trigger
Menu'sonClick. The input's native spinner (↑↓buttons) also fires only on the input element, so clicking the spinner
likewise never applies the value.
The same pattern exists in
insert-rowandinsert-columninputs.Fix
Allow
Enterin theonKeyDownhandler to programmatically invoke theparent menu item's click, which triggers the existing apply logic:
packages/react/src/components/ContextMenu/index.tsxTest Steps
Affected Files
packages/react/src/components/ContextMenu/index.tsxAffected Versions
Confirmed on
@fortune-sheet/react@1.0.4(latest at time of writing).Notes
The spinner click issue (value not applied when clicking ↑↓ without pressing
Enter) has the same root cause: the spinner fires a
changeevent on theinput but this never reaches the
Menu'sonClick. A more complete fixwould add an
onChangehandler to the input that immediately invokes theparent click — but that is a separate, larger change left as a follow-up.