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

๐Ÿ› [BugFix] ์ „์—ญ ๋ชจ๋‹ฌ์„ close ์‹œ unmount #232

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

yoopark
Copy link
Contributor

@yoopark yoopark commented Aug 7, 2023

Summary

ModalProvider์—์„œ ์ „์—ญ ๋ชจ๋‹ฌ์„ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ์€ ๋™์ผ.

ํ•˜์ง€๋งŒ, ์ „์—ญ ๋ชจ๋‹ฌ์˜ ๊ฒฝ์šฐ close ๋˜์—ˆ์„ ๋•Œ unmount๊ฐ€ ๋˜์–ด์•ผ ํ•จ. (์•„๋ž˜ ModalProvider.tsx์˜ ๋ณ€๊ฒฝ์  ์ฐธ๊ณ )

background์—์„œ ๊ณ„์† keydown์„ listening ํ•˜๊ณ  ์žˆ๋Š” ๋ฒ„๊ทธ๊ฐ€ ์žˆ์—ˆ์Œ.

Describe your changes

Mac + K ๋ฒ„ํŠผ์œผ๋กœ Spotlight๋ฅผ ํ™œ์„ฑํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ๊ธฐ์กด ModalProvider์˜ ๋ฐฉ์‹์€ open & close ๊ฐ€ mount & unmount๋ฅผ ๋ถˆ๋Ÿฌ์˜ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ „์—ญ ๋ชจ๋‹ฌ์€ App mount ์‹œ์— ํ•จ๊ป˜ mount ๋˜๋ฉฐ, open & close ๋Š” mount & unmount์— ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

์ผ๋ก€๋กœ, Spotlight๋ฅผ ๋„๊ณ  ํŽ˜์ด์ง€๋ฅผ ์›€์ง์ด์ง€ ์•Š์€ ์ฑ„ ๋‹ค์‹œ ์ผœ๋ฉด ์˜ˆ์ „ ๊ฒ€์ƒ‰์–ด๊ฐ€ ๋‚จ์•„์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๊ฒƒ์„ ๋‚˜๋ฆ„์˜ ๊ธฐ๋Šฅ์ด๋ผ ์ƒ๊ฐํ•˜๊ณ  ๋„˜๊ฒผ์—ˆ๋Š”๋ฐ, ์ด๋ฒˆ #199 ์ด์Šˆ๋ฅผ ์‚ดํŽด๋ณด๋ฉด์„œ Spotlight์˜ ArrowUp, ArrowDown ์ด close ์ƒํƒœ์—๋„ listening ํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์ด ์›์ธ์ž„์„ ๋ฐœ๊ฒฌํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๋”ํ•˜์—ฌ, Spotlight์—์„œ ๊ฒ€์ƒ‰ํ•œ ์ดํ›„ Spotlight๋ฅผ ๋„๊ณ  ArrowUp, ArrowDown์„ ๋ˆ„๋ฅด๋ฉด Spotlight์˜ Focus๊ฐ€ ์›€์ง์—ฌ๋ฒ„๋ฆฌ๋Š” ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋‹ค๋Š” ์‚ฌ์‹ค์„ ์•Œ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ ๊ธฐ์กด @jpham005 ๋‹˜๊ณผ ์–˜๊ธฐ๋ฅผ ๋‚˜๋ˆˆ ๋ฐฉ์‹๋Œ€๋กœ, close ์‹œ ์ „์—ญ ๋ชจ๋‹ฌ์„ unmount ์‹œํ‚ค๋Š” ๋ฐฉ์‹์œผ๋กœ ๋กœ์ง์„ ๋ณ€๊ฒฝํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Issue number and link

@yoopark yoopark added the bug Something isn't working label Aug 7, 2023
@yoopark yoopark requested a review from jpham005 August 7, 2023 07:25
@yoopark yoopark self-assigned this Aug 7, 2023
@yoopark yoopark marked this pull request as ready for review August 7, 2023 07:25
Copy link
Member

@jpham005 jpham005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dialog ์— isOpen ์„ ์ „๋‹ฌํ•˜๋Š” ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?

@yoopark
Copy link
Contributor Author

yoopark commented Aug 7, 2023

dialog ์— isOpen ์„ ์ „๋‹ฌํ•˜๋Š” ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?

์ „์—ญ ๋ชจ๋‹ฌ์˜ ๊ฒฝ์šฐ์—๋Š” ํ•ญ์ƒ true ์ด๊ฒ ๊ตฐ์š”.

Dialog๊ฐ€ isOpen์„ prop์œผ๋กœ ๋ฐ›๊ธฐ๋Š” ํ•ด์„œ, isOpen={isSpotlightOpen}์„ isOpen์œผ๋กœ ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

@yoopark yoopark merged commit dabd1ff into main Aug 7, 2023
@yoopark yoopark deleted the fix/arrow-scroll branch August 7, 2023 08:18
@42sungwook 42sungwook changed the title ๐Ÿ› fix: ์ „์—ญ ๋ชจ๋‹ฌ์„ close ์‹œ unmount ๐Ÿ› [BugFix] ์ „์—ญ ๋ชจ๋‹ฌ์„ close ์‹œ unmount Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: โœ… Done
Development

Successfully merging this pull request may close these issues.

Command + โ†‘โ†“ ์Šคํฌ๋กค ๋‹จ์ถ•ํ‚ค ๋ฐ”์ธ๋”ฉ
2 participants