From 47d2b1dcb75b33cca2a262d7ab42918759ced66c Mon Sep 17 00:00:00 2001 From: Qing Date: Tue, 27 Feb 2024 22:06:39 +0800 Subject: [PATCH] fix textarea space not work --- web_app/src/components/ui/textarea.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web_app/src/components/ui/textarea.tsx b/web_app/src/components/ui/textarea.tsx index 80c2e38..b940703 100644 --- a/web_app/src/components/ui/textarea.tsx +++ b/web_app/src/components/ui/textarea.tsx @@ -1,12 +1,23 @@ import * as React from "react" import { cn } from "@/lib/utils" +import { useStore } from "@/lib/states" export interface TextareaProps extends React.TextareaHTMLAttributes {} const Textarea = React.forwardRef( ({ className, ...props }, ref) => { + const updateAppState = useStore((state) => state.updateAppState) + + const handleOnFocus = () => { + updateAppState({ disableShortCuts: true }) + } + + const handleOnBlur = () => { + updateAppState({ disableShortCuts: false }) + } + return (