[eric] palettes: portal Cmd+K and Cmd+F to a body top layer so cards stop painting over them

This commit is contained in:
ciregenz
2026-07-30 22:07:26 -07:00
parent 97ddc89aa9
commit acfc6eb8e7
3 changed files with 22 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
import React from 'react';
import { createPortal } from 'react-dom';
// A low-z or transformed ancestor traps position:fixed, so anything that must win every stacking fight mounts on body instead.
const TOP_LAYER = 2147483647;
interface Props {
children: React.ReactNode;
}
const TopLayerPortal: React.FC<Props> = ({ children }) => createPortal(
<div style={{ position: 'fixed', inset: 0, zIndex: TOP_LAYER }}>{children}</div>,
document.body,
);
export default TopLayerPortal;