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

support keepOpenOnBlur props for Overlay #1614

Open
2 tasks
Tracked by #1800
yangwooseong opened this issue Sep 11, 2023 · 0 comments
Open
2 tasks
Tracked by #1800

support keepOpenOnBlur props for Overlay #1614

yangwooseong opened this issue Sep 11, 2023 · 0 comments
Assignees
Labels
enhancement Issues or PR related to making existing features better

Comments

@yangwooseong
Copy link
Collaborator

yangwooseong commented Sep 11, 2023

Description

Overlay 의 바깥을 클릭해도 Overlay 가 닫히지 않도록 하는 옵션을 추가합니다.

비슷하지만 다른 목적을 가지는 enableClickOutside 속성이 이미 있습니다.
#326 와 아래 코드로 판단하건대 오버레이를 닫게 하면서 클릭 이벤트까지 동작시키려는 목적이었던 것 같습니다. 하지만 enableClickOutside 속성이 true 라도 오버레이 밖을 클릭하면 오버레이는 닫히기 때문에, 안닫히게 하려면 바깥을 클릭하더라도 showtrue인 채로 남아있게 하면서 enableClickOutside 까지 true 로 해야합니다.

const handleHideOverlay = useCallback((event: any) => {
if (!event.target?.closest(Styled.Overlay)) {
onHide()
if (!enableClickOutside) {
event.stopPropagation()
}
}
}, [
enableClickOutside,
onHide,
])

Reasons for suggestion

Overlay을 닫게 하지 않으려면 사용처에서 불필요하게 복잡한 로직이 필요합니다.

Proposed solution

현재 #326 에서 기획한 기능은 이제 데스크에서 없는 것으로 판단됩니다. 따라서 다음과 같은 아이템을 생각해볼 수 있습니다.

  • Overlay 의 바깥을 클릭해도 Overlay 가 닫히지 않도록 하는 옵션을 추가 (keepOpenOnBlur?)
  • 위 속성을 추가한 뒤에도 여전히 enableClickOutside 속성이 필요한지 고민해보고 불필요하다면 제거

References

No response

@yangwooseong yangwooseong added status:need triage Issue or PR that need triage attention enhancement Issues or PR related to making existing features better and removed status:need triage Issue or PR that need triage attention labels Sep 11, 2023
@yangwooseong yangwooseong changed the title support CloseOnBlur props for Overlay support keepOpenOnBlur props for Overlay Oct 31, 2023
@yangwooseong yangwooseong self-assigned this Oct 31, 2023
@sungik-choi sungik-choi mentioned this issue Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues or PR related to making existing features better
Projects
Status: 🏃‍♀️ In progress
Development

No branches or pull requests

1 participant