fix: use native textarea scrolling for raw config editor

This commit is contained in:
XYSK-lilong007 2026-03-12 01:21:44 +08:00
parent 4a8a2e9c23
commit fcf9545736

View file

@ -22,7 +22,6 @@ import {
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "@/components/ui/card" } from "@/components/ui/card"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Textarea } from "@/components/ui/textarea" import { Textarea } from "@/components/ui/textarea"
export function RawJsonPanel() { export function RawJsonPanel() {
@ -142,17 +141,15 @@ export function RawJsonPanel() {
</div> </div>
)} )}
<div className="bg-muted/30 relative rounded-lg border"> <div className="bg-muted/30 relative rounded-lg border">
<ScrollArea className="h-[calc(100vh-20rem)] min-h-[200px]"> <Textarea
<Textarea value={effectiveEditorValue}
value={effectiveEditorValue} onChange={(e) => {
onChange={(e) => { setEditorValue(e.target.value)
setEditorValue(e.target.value) setIsDirty(true)
setIsDirty(true) }}
}} className="h-[calc(100vh-20rem)] min-h-[200px] w-full resize-none overflow-auto border-0 bg-transparent px-4 py-3 font-mono text-sm shadow-none focus-visible:ring-0"
className="min-h-[200px] resize-none border-0 bg-transparent px-4 py-3 font-mono text-sm shadow-none focus-visible:ring-0" placeholder={t("pages.config.json_placeholder")}
placeholder={t("pages.config.json_placeholder")} />
/>
</ScrollArea>
</div> </div>
<div className="flex justify-end space-x-2"> <div className="flex justify-end space-x-2">
<Button <Button