Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure ctrl+i interactive toggle hotkey works on Windows #854

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/pages/docs/api-reference/app-state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The mode for the preview area, controlling whether or not the user can interact
- **`"edit"` (default)**: Components can be dragged and modified. An overlay prevents interaction with the underlying component.
- **`"interactive"`**: Editing functionality is disabled. The user can interact with the underlying component.

Puck does not currently provide the UI to control this value, but it can be toggled via the `meta+i` hotkey.
Puck does not currently provide the UI to control this value, but it can be toggled via the `cmd+i` or `ctrl+i` hotkeys.

---

Expand Down
6 changes: 6 additions & 0 deletions packages/core/lib/use-preview-mode-hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ export const usePreviewModeHotkeys = (
preventDefault: true,
document: resolvedFrame,
});
// For Windows
useHotkeys("ctrl+i", toggleInteractive, { preventDefault: true });
useHotkeys("ctrl+i", toggleInteractiveIframe, {
preventDefault: true,
document: resolvedFrame,
});
};
Loading