UI Components์ถ์ฒ: CSS-Tricks์กฐํ์ 11
There is No Need to Trap Focus on a Dialog Element
By Zell Liew2026๋
1์ 27์ผ
**There is No Need to Trap Focus on a Dialog Element**
I was building a Modal component that uses the <dialog> element’s showModal method. While testing the component, I discovered I could tab out of the <dialog> (in modal mode) and onto the address bar. And I was surprised โ accessibility advice around modals have commonly taught us to trap focus within the modal. So this seems wrong to me. Upon further research, it seems like we no longer need to trap focus within the <dialog> (even in modal mode)...
---
**[devsupporter ํด์ค]**
์ด ๊ธฐ์ฌ๋ CSS-Tricks์์ ์ ๊ณตํ๋ ์ต์ ๊ฐ๋ฐ ๋ํฅ์ ๋๋ค. ๊ด๋ จ ๋๊ตฌ๋ ๊ธฐ์ ์ ๋ํด ๋ ์์๋ณด์๋ ค๋ฉด ์๋ณธ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
I was building a Modal component that uses the <dialog> element’s showModal method. While testing the component, I discovered I could tab out of the <dialog> (in modal mode) and onto the address bar. And I was surprised โ accessibility advice around modals have commonly taught us to trap focus within the modal. So this seems wrong to me. Upon further research, it seems like we no longer need to trap focus within the <dialog> (even in modal mode)...
---
**[devsupporter ํด์ค]**
์ด ๊ธฐ์ฌ๋ CSS-Tricks์์ ์ ๊ณตํ๋ ์ต์ ๊ฐ๋ฐ ๋ํฅ์ ๋๋ค. ๊ด๋ จ ๋๊ตฌ๋ ๊ธฐ์ ์ ๋ํด ๋ ์์๋ณด์๋ ค๋ฉด ์๋ณธ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
