Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog: breakpoints are janky #5551

Closed
KOliver94 opened this issue Dec 8, 2023 · 5 comments · Fixed by #5586 or #5763
Closed

Dialog: breakpoints are janky #5551

KOliver94 opened this issue Dec 8, 2023 · 5 comments · Fixed by #5586 or #5763
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@KOliver94
Copy link
Contributor

Describe the bug

There are multiple issues with Dialog breakpoints right now.

Issue 1: Breakpoints does not work in React.StrictMode. You can even see in the provided CodeSandbox project that the necessary CSS parts are not added. As I see that was an issue earlier as well #3922.

Issue 2: The value of style has priority over the breakpoints values. I just removed the strict mode from the CodeSandbox example project and you can see the following:
image

Reproducer

https://codesandbox.io/s/primereact-dialog-breakpoints-issue-7dxvrm

PrimeReact version

10.2.1

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@KOliver94 KOliver94 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 8, 2023
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 8, 2023
@melloware melloware added this to the 10.2.2 milestone Dec 13, 2023
@KOliver94
Copy link
Contributor Author

Hey @kl-nevermore and @melloware,

The fix seems to work for Dialog but it still seems to be broken for ConfirmDialog. Can you check it please?

Thank you!

@melloware
Copy link
Member

@KOliver94 can you open a new ticket for ConfirmDialog. It seems like ConfirmDialog doesn't define breakpoints as a property or pass it through to Dialog from what I am looking at the code?

@melloware melloware modified the milestones: 10.3.0, 10.3.1 Jan 13, 2024
@melloware
Copy link
Member

HMmm actually it does pass through BreakPoints.

breakpoints: getPropValue('breakpoints'),

@melloware
Copy link
Member

@KOliver94 I just tested it with this and it seems to be working for me?

<ConfirmDialog
    group="declarative"
    visible={visible}
    onHide={() => setVisible(false)}
    message="Are you sure you want to proceed?"
    header="Confirmation"
    icon="pi pi-exclamation-triangle"
    accept={accept}
    reject={reject}
    style={{ width: '50vw' }}
    breakpoints={{ '1100px': '75vw', '960px': '100vw' }}
/>

@KOliver94
Copy link
Contributor Author

Thank you @melloware, I found the issue with my code. Earlier breakpoints only worked if I passed them directly to the <ConfirmDialog> component even if I used confirmDialog function to invoke it. It seems now it is fixed and I need to add the breakpoints to the function to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants