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

Calendar: Panel width too small with default Tailwind #5830

Closed
zawasp opened this issue Jan 23, 2024 · 11 comments · Fixed by #5898 or #5913
Closed

Calendar: Panel width too small with default Tailwind #5830

zawasp opened this issue Jan 23, 2024 · 11 comments · Fixed by #5898 or #5913
Assignees
Labels
Component: Tailwind Tailwind specific issue
Milestone

Comments

@zawasp
Copy link
Contributor

zawasp commented Jan 23, 2024

Describe the bug

Calendar panel is too small.
image

Reproducer

https://stackblitz.com/edit/ewd4me?file=src%2FApp.jsx

PrimeReact version

10.3.3

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

Added simple Calendar with default Tailwind styling.

Expected behavior

Panel extends the full width of its children

@zawasp zawasp added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 23, 2024
@melloware melloware added Component: Tailwind Tailwind specific issue and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 23, 2024
@melloware
Copy link
Member

I simplified your reproducer: https://stackblitz.com/edit/ewd4me?file=src%2FApp.jsx Definitely an issue I can't quite tell why though or what TailWind CSS is causing that

@melloware
Copy link
Member

I see the issue data-pc-section="panel" is calculating to short of a width.

@melloware
Copy link
Member

Looks like a bug with width calculation that is not happening on styled mode.

            if (!props.touchUI && overlayRef && overlayRef.current && inputRef && inputRef.current && !appendDisabled()) {
                let inputWidth = DomHandler.getOuterWidth(inputRef.current);

                // #5435 must have reasonable width if input is too small
                if (inputWidth < 220) {
                    inputWidth = 220;
                }

                if (props.view === 'date') {
                    overlayRef.current.style.width = DomHandler.getOuterWidth(overlayRef.current) + 'px';
                    overlayRef.current.style.minWidth = inputWidth + 'px';
                } else {
                    overlayRef.current.style.minWidth = inputWidth + 'px';
                    overlayRef.current.style.width = inputWidth + 'px';
                }
            }

@zawasp
Copy link
Contributor Author

zawasp commented Feb 5, 2024

Any updates?

@melloware melloware self-assigned this Feb 5, 2024
@melloware melloware added this to the 10.5.0 milestone Feb 5, 2024
melloware added a commit to melloware/primereact that referenced this issue Feb 5, 2024
@zawasp
Copy link
Contributor Author

zawasp commented Feb 6, 2024

@melloware thanks, however this doesn't seem to be fixed yet:
https://stackblitz.com/edit/stackblitz-starters-36rdqj

Please reopen.

@melloware melloware reopened this Feb 6, 2024
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 6, 2024
@melloware
Copy link
Member

Weird if you inspect the CSS and uncheck min-width it works but that is is exactly what my PR did. Do not add minWidth in unstyled mode.

image

So I have no idea where that min-width is coming from?

@melloware melloware removed the Component: Tailwind Tailwind specific issue label Feb 6, 2024
@melloware melloware modified the milestones: 10.5.0, 10.5.1 Feb 6, 2024
@melloware melloware added Component: Tailwind Tailwind specific issue and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 6, 2024
@zawasp
Copy link
Contributor Author

zawasp commented Feb 6, 2024

@melloware
Copy link
Member

@zawasp can you submit a PR and update the doc page as well like you did for the separator?

@melloware
Copy link
Member

@zawasp according to @vaelu this is still not working in 10.5.2?

@vaelu
Copy link
Contributor

vaelu commented Mar 6, 2024

@melloware *10.5.1. Version 10.5.2 is not out yet, or is it?

@melloware
Copy link
Member

10.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Tailwind Tailwind specific issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants