fix: 도구 모음 클릭 시 마우스 드래그 선택 보존 (closes #780)#787
Closed
oksure wants to merge 1 commit into
Closed
Conversation
마우스 드래그로 텍스트 블럭 선택 후 서식 도구 모음/도구 상자 버튼 클릭 시 focus 이동으로 cursor.hasSelection()이 false 반환 → 서식 미적용. #icon-toolbar, #style-bar 컨테이너에 mousedown preventDefault 추가. INPUT/SELECT 요소는 제외 (글꼴/크기 입력 필드는 포커스 필요).
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an editor UX bug where applying formatting via the style bar / icon toolbar fails after a mouse-drag text selection, due to focus moving away from the editor (hidden textarea blur) on toolbar mousedown.
Changes:
- Adds
mousedownpreventDefault()on#icon-toolbarand#style-barcontainer elements to prevent focus shifts that clear the current selection. - Exempts
<input>and<select>targets so user-focusable fields (font name/size, etc.) still work as expected.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edwardkim
added a commit
that referenced
this pull request
May 10, 2026
마우스 드래그로 텍스트 블럭 선택 후 서식 도구 모음 / 도구 상자 영역 영역 빈 영역 / 라벨 클릭 시 브라우저 기본 동작 (focus 이동) 영역 영역 hidden textarea blur → cursor.hasSelection() false → 서식 적용 미동작. 정정 (main.ts +11/-0): #icon-toolbar / #style-bar 컨테이너 영역 영역 mousedown preventDefault — input/select 만 제외 (글꼴명/크기 입력 사용자 포커스 보존). 검증: - tsc --noEmit ✅ - cargo test --release ALL GREEN - 광범위 sweep 170/170 same - WASM 4.68 MB 재빌드 - 작업지시자 웹 에디터 인터랙션 검증 ✅ 통과 (마우스 드래그 선택 + 도구 모음 클릭 + input/select 보존 + 키보드 선택 회귀 부재) closes #780
Owner
|
@oksure 검토 완료했습니다. 감사합니다. 처리 결과Merge commit: 본질컨테이너 (#icon-toolbar / #style-bar) 영역 영역 mousedown preventDefault — input/select 제외 영역 영역 사용자 포커스 보존 정합. 마우스 드래그 선택 후 도구 모음 빈 영역 / 라벨 클릭 시 textarea blur 차단. 검증
closes #780. 5/11 사이클 2번째 PR — 수고하셨습니다. |
Owner
|
Merged. Merge commit: 5171295 |
edwardkim
added a commit
that referenced
this pull request
May 10, 2026
edwardkim
added a commit
that referenced
this pull request
May 10, 2026
5/10 + 5/11 사이클 누적 — 외부 기여자 다수 PR 30+ 머지. Cargo.toml + rhwp-vscode/package.json + npm/editor/package.json + rhwp-studio/package.json: 0.7.10 → 0.7.11 rhwp-vscode/CHANGELOG.md: [0.7.11] 항목 추가 핵심 변경: - Skia native raster P8 (#761) + P9 (#769) — Layer IR contract hardening + text replay parity - HWP3 native 렌더링 (#753) — hwp3-sample10 8 단계 정정 + Git LFS pdf-large/ 신규 - 페이지네이션 정정 (#778) — Task #703 다단 컬럼 분배 회귀 정정 - rhwp-studio 인터랙션 (PR #781/#786/#787/#788) — scrollbar/수식/표 셀/도구 모음 결함 정정 - rhwp-studio editor 신규 기능 (PR #728/#748/#750/#760 등) — 표 편집 Undo/Redo + 다단 설정 + 다수 단축키
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.
요약
마우스 드래그로 텍스트 블럭 선택 후 서식 도구 모음(style-bar) 또는 도구 상자(icon-toolbar) 버튼 클릭 시 폰트 크기 변경 등 서식 적용이 동작하지 않는 문제 수정.
원인
개별 버튼에
mousedown→preventDefault()처리가 되어 있으나, 버튼 간 빈 영역/라벨 클릭 시 브라우저 기본 동작(focus 이동)으로 hidden textarea가 blur →cursor.hasSelection()false 반환 →format-char/adjustFontSize조기 종료.수정 내용
#icon-toolbar,#style-bar컨테이너에 mousedownpreventDefault추가:<input>,<select>요소는 제외 (글꼴명/크기 입력 필드는 사용자 포커스 필요)preventDefault()호출검증
tsc --noEmit✅ (기존 @wasm 모듈 에러 외 신규 없음)감사합니다.