diff --git a/frontend/src/components/QuickAdd.tsx b/frontend/src/components/QuickAdd.tsx index cb145637..92c3dd21 100644 --- a/frontend/src/components/QuickAdd.tsx +++ b/frontend/src/components/QuickAdd.tsx @@ -11,10 +11,12 @@ export const QuickAdd = ({ addIssueActivity, toastList, onToastListUpdate, + issueInputRef, }: { addIssueActivity: (pair: IssueActivityPair) => void; toastList: ToastMsg[]; onToastListUpdate: (newToast: ToastMsg) => void; + issueInutRef: React.RefObject; }) => { const [activities, setActivities] = useState([]); const [issue, setIssue] = useState(null); @@ -204,7 +206,6 @@ export const QuickAdd = ({ const suggestionsRef = useRef(null); useEscaper(suggestionsRef, handleHideAutocomplete); - const issueInputRef = useRef(null); const handleInputToAutocompleteFocus = (event: any) => { event.preventDefault(); @@ -254,6 +255,7 @@ export const QuickAdd = ({
{ if (context.user === null) return <>; + const issueInputRef = useRef(null); + // Main content return ( <> @@ -680,7 +682,18 @@ export const Report = () => { /> -
+
{ + if (e.key.toLowerCase() === "s" && e.ctrlKey) { + e.preventDefault(); + handleSave(); + } else if (e.key.toLowerCase() === "a" && e.ctrlKey) { + e.preventDefault(); + issueInputRef.current.focus(); + } + }} + > {favorites && favorites.length > 0 && (
@@ -858,6 +871,7 @@ export const Report = () => { addIssueActivity={addIssueActivityHandler} toastList={toastList} onToastListUpdate={handleToastListUpdate} + issueInputRef={issueInputRef} >
{toastList.length > 0 && ( @@ -869,7 +883,11 @@ export const Report = () => {

⚠ You have unsaved changes

)} -