Skip to content

Commit 7fadf80

Browse files
committed
Add target check to handle_copy_key so copy handling only proceeds for the WEB target
- prompt copying shortcut should be only invoked in 'web' target ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ └── Main │ └── MainView │ ├── MainView.tsx │ └── hooks │ └── use-keyboard-shortcuts.ts └── packages ├── shared │ └── src │ └── types │ └── target.ts └── ui └── src └── components └── editor └── common └── prompts ├── PromptField │ ├── PromptField.module.scss │ ├── PromptField.stories.tsx │ ├── PromptField.tsx │ ├── hooks │ │ ├── use-drag-drop.ts │ │ ├── use-dropdown.ts │ │ ├── use-ghost-text.ts │ │ ├── use-handlers │ │ │ ├── handle-copy.ts │ │ │ ├── handle-cut.ts │ │ │ ├── handle-input-change.ts │ │ │ ├── handle-input-click.ts │ │ │ ├── handle-key-down.ts │ │ │ ├── handle-paste.ts │ │ │ ├── handle-submit.ts │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ ├── use-handlers.ts │ │ │ └── utils.ts │ │ └── use-keyboard-shortcuts.ts │ └── index.ts ├── Template │ ├── Template.module.scss │ ├── Template.tsx │ └── index.ts └── shared └── symbols ├── caret.ts ├── get-highlighted-text.tsx ├── index.ts ├── position-mapping.ts ├── prompt-symbols.module.scss ├── reconstruct-raw-value.ts └── use-symbol-deletion.ts
1 parent da3342c commit 7fadf80

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • packages/ui/src/components/editor/common/prompts/PromptField/hooks/use-handlers

‎packages/ui/src/components/editor/common/prompts/PromptField/hooks/use-handlers/handle-key-down.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ export const create_handle_key_down = (
101101
}
102102

103103
const handle_copy_key = (e: React.KeyboardEvent<HTMLDivElement>) => {
104+
if (props.target != 'WEB') {
105+
return false
106+
}
107+
104108
const selection = window.getSelection()
105109
if (!selection || selection.rangeCount == 0 || selection.isCollapsed) {
106110
e.preventDefault()

0 commit comments

Comments
 (0)