0Pricing
Web Accessibility Academy · Ders

Bir Katman Kapandığında Odağı Geri Getirme

Kullanıcıyı kaldığı yere geri döndürün.

Bir Katman Kapandığında Odağı Geri Getirme, CoddyKit'te ücretsiz bir Web Accessibility Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Web Accessibility Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Web Accessibility Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Layers Borrow Focus

When a modal, menu, or drawer opens, focus moves inside it. When it closes, you are responsible for returning focus to where the user was.

The Lost-Focus Problem

If a closed layer leaves focus on a removed element, it falls back to the page body. The user is stranded with no sense of place.

Remember the Trigger

The fix starts before opening: save a reference to the element that triggered the layer, usually document.activeElement.

const trigger = document.activeElement;

Restore on Close

When the layer closes, call focus() on that saved trigger so the user lands right back where they started.

trigger.focus();

The Full Round Trip

Open: store the trigger and focus the layer. Close: hide it and restore the trigger. That loop is the focus contract of any dismissible layer. 🔁

Native dialog Helps

The browser's dialog element restores focus to the opener automatically when you call close(), saving you the manual bookkeeping.

myDialog.close();

Handle Every Exit Path

Restore focus no matter how the layer closes: a Close button, the Escape key, or a click on the backdrop should all return the user.

When the Trigger Is Gone

If the trigger was removed while the layer was open, send focus to a sensible nearby element instead, never to nowhere.

Why This Matters So Much

Sighted mouse users barely notice, but for keyboard and screen reader users a missed focus return can make a feature unusable.

Test It Keyboard-Only

Open the layer with Enter, close it with Escape, and confirm the focus ring reappears on the button that opened it.

Make It a Habit

Treat focus return as part of building any overlay, not an afterthought. Wire it the moment you add open and close logic.

Quick Check

A custom modal closes. What is the correct destination for focus?

Recap

You can now close the loop: save the trigger on open, restore focus to it on every close path, and lean on native dialog when you can. 🎯

Sıkça Sorulan Sorular

“Bir Katman Kapandığında Odağı Geri Getirme” dersi ücretsiz mi?

Evet — “Bir Katman Kapandığında Odağı Geri Getirme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Web Accessibility Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Web Accessibility Academy kursu toplamda 4 dersten oluşur.

“Bir Katman Kapandığında Odağı Geri Getirme” dersinde ne öğreneceğim?

Kullanıcıyı kaldığı yere geri döndürün. Web Accessibility Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Web Accessibility Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Web Accessibility Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.

“Bir Katman Kapandığında Odağı Geri Getirme” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Web Accessibility Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Web Accessibility Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. tabindex 0, -1 ve Pozitif Değerlerden Kaçınma
  2. Bir Eylemden Sonra Odağı Taşıma
  3. Bir Katman Kapandığında Odağı Geri Getirme
  4. Bileşenlerde Hareketli tabindex Yönetimi
← Web Accessibility Academy Sayfasına Dön