-
Notifications
You must be signed in to change notification settings - Fork 1
fix: 텍스트 드래그 안되는 문제 해결 #831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clearFocus()호출 후currentFocus가 null이 될 수 있습니다.Line 68에서
clearFocus()를 호출한 후, Line 71에서currentFocus?.windowToken을 사용하고 있습니다. 포커스가 해제되면currentFocus가 null을 반환할 수 있어,hideSoftInputFromWindow에 null이 전달될 수 있습니다.이미
focusView를 캡처해두었으므로, 해당 뷰의windowToken을 직접 사용하는 것이 안전합니다.🛠️ 수정 제안
if (!outRect.contains(ev.rawX.toInt(), ev.rawY.toInt())) { focusView.clearFocus() val imm: InputMethodManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager - imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0) + imm.hideSoftInputFromWindow(focusView.windowToken, 0) }📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이것만 봐주세용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR 설명 이미지: 텍스트 "etnstnwtnwtn"이 청록색으로 선택되어 있고, 상단에 잘라내기·복사·번역·공유 툴바가 표시되어 있습니다. 이번 PR의 드래그/선택 수정이 정상 작동하는 것을 보여주고 있습니다. 🎉
@m6z1, 제가 남긴 댓글 내용만 확인해 드릴게요.지적 내용은 유효합니다.
clearFocus()를 호출한 직후currentFocus는 null을 반환할 수 있기 때문에,hideSoftInputFromWindow에 null 토큰이 전달될 수 있습니다.focusView는 이미clearFocus()호출 전에 캡처해 두었으므로, 그 참조를 그대로 사용하는 것이 안전합니다:if (!outRect.contains(ev.rawX.toInt(), ev.rawY.toInt())) { focusView.clearFocus() val imm: InputMethodManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager - imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0) + imm.hideSoftInputFromWindow(focusView.windowToken, 0) }Android의 IMM이 null 토큰을 내부적으로 처리하더라도,
focusView.windowToken을 직접 쓰는 것이 의도가 명확하고 더 견고합니다.