mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-26 22:42:23 +02:00
[eric] browser: don't auto-focus/re-center on resize, tab add/close, or tab drag
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user