Skip to content

provider not affect modal content #13003

Open
@etroynov

Description

@etroynov

Describe the Bug

I created new provider for radix-ui:

'use client';

import { Theme } from '@radix-ui/themes';
import { type FC, type PropsWithChildren } from 'react';

import { useTheme } from '@payloadcms/ui';

const AppProvider: FC<PropsWithChildren> = ({ children }) => {
  const { theme } = useTheme();

  return <Theme appearance={theme}>{children}</Theme>;
};

export default AppProvider;

It works fine outside modal:
Image

but it doesn't work inside modal:
Image

It's happens because provider not wrap modal container:
Image

If I will move container manually everything working as expected:
Image

Link to the code that reproduces this issue

https://github.com/rLukoyanov/crm

Reproduction Steps

Create custom provider:

'use client';

import { Theme } from '@radix-ui/themes';
import { type FC, type PropsWithChildren } from 'react';

import { useTheme } from '@payloadcms/ui';

const AppProvider: FC<PropsWithChildren> = ({ children }) => {
  const { theme } = useTheme();

  return <Theme appearance={theme}>{children}</Theme>;
};

export default AppProvider;

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

Binaries:
  Node: 24.1.0
  npm: 11.3.0
  Yarn: N/A
  pnpm: 10.12.1
Relevant Packages:
  payload: 3.44.0
  next: 15.3.4
  @payloadcms/db-mongodb: 3.44.0
  @payloadcms/email-nodemailer: 3.44.0
  @payloadcms/graphql: 3.44.0
  @payloadcms/next/utilities: 3.44.0
  @payloadcms/plugin-cloud-storage: 3.44.0
  @payloadcms/plugin-form-builder: 3.44.0
  @payloadcms/plugin-seo: 3.44.0
  @payloadcms/richtext-lexical: 3.44.0
  @payloadcms/richtext-slate: 3.44.0
  @payloadcms/storage-s3: 3.44.0
  @payloadcms/translations: 3.44.0
  @payloadcms/ui/shared: 3.44.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions