Skip to content
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

[Bug Report] ScrollView 클릭 시, Keyboard hide 되지 않는 현상 #57

Open
joseph704 opened this issue Dec 16, 2022 · 1 comment
Open
Assignees
Labels
🐞Bug 예상치 못한 에러 또는 문제가 있음 🙏 Help 조언, 경험공유 등 도움이 필요

Comments

@joseph704
Copy link
Member

발견한 문제

키보드가 올라와 있는 상태에서 여백 클릭 시 키보드룰 내리기 위해 구현했던 View의 hideKeyBoard 사용 했을 때,
ScrollView나 List 클릭 시에는 키보드가 내리가지 않음

문제 상황 접근 방법

View의 hideKeyboard 함수를 구성하고자 하는 화면의 최상위 뷰에 구현시켜 놓을 시, 하위뷰에 있는 ScrollView나 List 클릭 시 키보드가 내려가지 않음

기대 동작

키보드가 올라와 있는 상황에서 ScrollView나 List 클릭 시 키보드가 내려오도록 수정

환경 정보

Device: iPhone 12 mini
iOS: iOS 16.1
Xcode: 14.1

스크린샷

No response

@joseph704 joseph704 added 🐞Bug 예상치 못한 에러 또는 문제가 있음 🙏 Help 조언, 경험공유 등 도움이 필요 labels Dec 16, 2022
@joseph704 joseph704 self-assigned this Dec 16, 2022
@joseph704
Copy link
Member Author

@kipsong133 @keeplo @sustainable-git
ScrollView나 List에 다음과 같은 함수를 지정해 줘야합니다. 참고 부탁드립니다.

ex1) 
   ScrollView {
                LazyVStack {
                    ForEach(viewModel.recentQueries, id: \.self) { recentQuery in
                        recentQueryView(recentQueries: $viewModel.recentQueries, query: recentQuery)
                    }
                }
            }
            .onTapGesture {
                UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
            }

ex2)
   List {
                ArticleRow()
                ArticleRow()
                ArticleRow()
                ArticleRow()
                ArticleRow()
            }
            .listStyle(.plain)
            .frame(maxWidth: .infinity)
            .onTapGesture {
                UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞Bug 예상치 못한 에러 또는 문제가 있음 🙏 Help 조언, 경험공유 등 도움이 필요
Projects
None yet
Development

No branches or pull requests

1 participant