ui: Select component throwing "too much reccursion error" when inside Dialog component

The error appears when I interact with the select component

Screenshot from 2023-07-04 13-32-57

Dialog component;

      <Dialog>
        <DialogTrigger asChild>
          <Button>Add Tenant</Button>
        </DialogTrigger>
        <DialogContent>
          <AddTenantForm />
        </DialogContent>
      </Dialog>

form with select component;

export const AddTenantForm = async () => {
  return (
    <form>
      <Label htmlFor="fist_name">First Name</Label>
      <Input type="text" name="fist_name" id="fist_name" />

      <Label htmlFor="second_name">Second Name</Label>
      <Input type="text" name="second_name" id="second_name" />

      <Label htmlFor="tenant_phone">Tenant Phone</Label>
      <Input type="text" name="tenant_phone" id="tenant_phone" />

      <Label htmlFor="tenant_email">Tenant Email</Label>
      <Input type="text" name="tenant_email" id="tenant_email" />

      <span>Select Building</span>
      <div>
        <Select>
          <SelectTrigger>
            <SelectValue placeholder="Select a building" />
          </SelectTrigger>

          <SelectContent>
            <SelectItem value="light">Light</SelectItem>
            <SelectItem value="dark">Dark</SelectItem>
            <SelectItem value="system">System</SelectItem>
          </SelectContent>
        </Select>
      </div>

      {/* A Unit select will come here..after the building is selected */}
      <div>Unit Select Comp</div>
      {/* BUG WALKAROUND shad's date picker not working */}
      <Label htmlFor="move_in_date">Move In Date</Label>
      <Input type="date" name="move_in_date" id="move_in_date" />
      {/*TODO Make tenant acc number automatic */}
      <Label htmlFor="basic_deposit">Deposit Paid</Label>
      <Input type="number" name="basic_deposit" id="basic_deposit" />
    </form>

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 17 (1 by maintainers)

Most upvoted comments

Hi @kimutai-codes. I just tested out the code you provided but I cannot reproduce the issue you’re encountering (I tried both on Chrome and Firefox). It’s probably related to something else in your project. If you can provide more code that might be causing the issue, I’m happy to help.

Oh man. I spent all morning looking into the Too much redcursion errors (100s of them) I was seeing in FireFox when using a Select component inside a Dialog. Then I updated radix deps and made it all go away.

Why didn’t I just try updating first?🤦

How I fixed it

update all radix packages:

pnpm update @radix-ui/* --latest

which update my package.json to:

{
  "@radix-ui/react-accordion": "^1.2.0",
   "@radix-ui/react-checkbox": "^1.1.1",
   "@radix-ui/react-dialog": "^1.1.1",
   "@radix-ui/react-dropdown-menu": "^2.1.1",
   "@radix-ui/react-label": "^2.1.0",
   "@radix-ui/react-popover": "^1.1.1",
   "@radix-ui/react-scroll-area": "^1.1.0",
   "@radix-ui/react-select": "^2.1.1",
   "@radix-ui/react-slider": "^1.2.0",
   "@radix-ui/react-slot": "^1.1.0",
   "@radix-ui/react-tabs": "^1.1.0",
   "@radix-ui/react-toast": "^1.2.1",
   "@radix-ui/react-tooltip": "^1.1.2",
   }

delete node_modules and reinstall:

rm -rf ./node_modules/ && pnpm install

I was facing the same issue with these versions


"dependencies": {
    "@radix-ui/react-accordion": "^1.2.2",
    "@radix-ui/react-avatar": "^1.1.3",
    "@radix-ui/react-collapsible": "^1.1.3",
    "@radix-ui/react-dialog": "^1.1.14",
    "@radix-ui/react-dropdown-menu": "^2.1.6",
    "@radix-ui/react-label": "^2.1.4",
    "@radix-ui/react-menubar": "^1.1.14",
    "@radix-ui/react-popover": "^1.1.5",
    "@radix-ui/react-scroll-area": "^1.2.3",
    "@radix-ui/react-select": "^2.2.4",
    "@radix-ui/react-separator": "^1.1.2",
    "@radix-ui/react-slot": "^1.2.0",
    "@radix-ui/react-switch": "^1.1.2",
    "@radix-ui/react-toggle": "^1.1.8",
    "@radix-ui/react-toggle-group": "^1.1.1",
    "@radix-ui/react-tooltip": "^1.2.6",
}

I updated then to their latest versions using :


npx npm-check-updates '/@radix-ui\/react-/' -u
npm install


if you don’t have npm-check-updates package install it using:

npm install --save-dev npm-check-updates

after updating:


        "@radix-ui/react-accordion": "^1.2.11",
        "@radix-ui/react-avatar": "^1.1.10",
        "@radix-ui/react-collapsible": "^1.1.11",
        "@radix-ui/react-dialog": "^1.1.14",
        "@radix-ui/react-dropdown-menu": "^2.1.15",
        "@radix-ui/react-label": "^2.1.7",
        "@radix-ui/react-menubar": "^1.1.15",
        "@radix-ui/react-popover": "^1.1.14",
        "@radix-ui/react-scroll-area": "^1.2.9",
        "@radix-ui/react-select": "^2.2.5",
        "@radix-ui/react-separator": "^1.1.7",
        "@radix-ui/react-slot": "^1.2.3",
        "@radix-ui/react-switch": "^1.2.5",
        "@radix-ui/react-toggle": "^1.1.9",
        "@radix-ui/react-toggle-group": "^1.1.10",
        "@radix-ui/react-tooltip": "^1.2.7",


still having this problem with shadcn & Firefox in 2025. The fix for package.json provided above

"resolutions": {
   "@radix-ui/react-focus-scope": "1.0.4"
 }

worked for me.

Oh man. I spent all morning looking into the Too much redcursion errors (100s of them) I was seeing in FireFox when using a Select component inside a Dialog. Then I updated radix deps and made it all go away.

Why didn’t I just try updating first?🤦

I was having the same issue using Select inside a Dialog component. Fixed it simply by running npm update