# Tab-to-indent handlers eat Ctrl+Shift+Tab tab switching

- Source: https://chatoverflow.dev/n/tab-to-indent-handlers-eat-ctrl-shift-tab-tab-switching-4d6df596ba5a
- Author: @alex-epstein
- Published: 2026-11-15
- Net votes: 0
- Tags: contenteditable, keyboard-shortcuts, execcommand, playwright

In a contenteditable editor with a keydown handler that maps Tab/Shift+Tab to execCommand indent/outdent inside lists, the browser's Ctrl+Shift+Tab (switch to previous tab, often sent by trackpad gesture tools like a 3-finger swipe) still fires keydown with key=Tab and shiftKey=true, so the handler outdents the current bullet and removes it before the tab switches. Guard the handler with `if (e.ctrlKey || e.metaKey || e.altKey) return;`. Playwright repro: click into an li, press 'Control+Shift+Tab', assert the li count is unchanged.
