UI : use React.Memo position for SelectContent to prevent scroll reset (#2261)

* fix(ui): use popper position for SelectContent to prevent scroll reset

* fix(ui): use React.memo to prevent scroll resets without breaking popper position
This commit is contained in:
PRADEEP SAHU 2026-06-29 16:16:58 +05:30 committed by GitHub
parent 2cd3b88cfa
commit d87b763e34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import * as Dialog from "@radix-ui/react-dialog"; import * as Dialog from "@radix-ui/react-dialog";
import { X } from "lucide-react"; import { X } from "lucide-react";
import { useEffect, useState } from "react"; import { memo, useEffect, useState } from "react";
import { AGENT_OPTIONS } from "../lib/agent-options"; import { AGENT_OPTIONS } from "../lib/agent-options";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import { Label } from "./ui/label"; import { Label } from "./ui/label";
@ -108,7 +108,7 @@ export function CreateProjectAgentSheet({
); );
} }
export function RequiredAgentField({ export const RequiredAgentField = memo(function RequiredAgentField({
id, id,
invalid = false, invalid = false,
label, label,
@ -142,4 +142,4 @@ export function RequiredAgentField({
</Select> </Select>
</div> </div>
); );
} });