Skip to content

Commit c4cda77

Browse files
kubeclaude
andcommitted
Fix duplicate context call and hidden layer keyboard focus
- Merge two use(EditorContext) calls into one in SearchContent - Add visibility: hidden to inactive sidebar content layer to prevent keyboard focus reaching invisible elements Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c71d91f commit c4cda77

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

libs/@hashintel/petrinaut/src/views/Editor/panels/LeftSideBar/panel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const contentLayerStyle = cva({
6565
false: {
6666
opacity: "0",
6767
pointerEvents: "none",
68+
visibility: "hidden",
6869
},
6970
},
7071
direction: {

libs/@hashintel/petrinaut/src/views/Editor/panels/LeftSideBar/subviews/search-panel.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,17 @@ function useSearchableItems(): SearchableItem[] {
202202
// -- Components ---------------------------------------------------------------
203203

204204
const SearchContent: React.FC = () => {
205-
const { isSelected: checkIsSelected, selectItem } = use(EditorContext);
205+
const {
206+
isSelected: checkIsSelected,
207+
selectItem,
208+
searchInputRef,
209+
} = use(EditorContext);
206210
const allItems = useSearchableItems();
207211
const [query, setQuery] = useState("");
208212
const [focusedIndex, setFocusedIndex] = useState<number | null>(null);
209213
const listRef = useRef<HTMLDivElement>(null);
210214
const rowRefs = useRef<(HTMLDivElement | null)[]>([]);
211215

212-
const { searchInputRef } = use(EditorContext);
213-
214216
// Sync query from the input (the input lives in SearchTitle, so we read its value)
215217
useEffect(() => {
216218
const input = searchInputRef.current;

0 commit comments

Comments
 (0)