[eric] browser: don't auto-focus/re-center on resize, tab add/close, or tab drag

This commit is contained in:
ciregenz
2026-07-23 15:37:33 -07:00
parent 73a22ef799
commit f50bf60f78
2 changed files with 4 additions and 0 deletions
@@ -1004,6 +1004,7 @@ const BrowserCard: React.FC<Props> = ({
/>
</Box>
<Box
data-card-control
sx={{
display: 'flex',
flex: 1,
@@ -30,6 +30,9 @@ function pressLandedOnControl(target: EventTarget | null | undefined): boolean {
while (el) {
if (el.hasAttribute(SELECT_ATTR)) return false;
if (CONTROL_TAGS.has(el.tagName) || el.isContentEditable || el.getAttribute('role') === 'button') return true;
// Card-chrome zones (browser tab strip + / x / tab-drag, resize handles) select+raise the card but
// must NOT re-center the camera on it, managing a card's frame or tabs is not a "focus this" gesture.
if (el.hasAttribute('data-card-control') || (el.classList && el.classList.contains('resize-handle'))) return true;
el = el.parentElement;
}
return false;