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: 10.8.4 - When selecting a Dropdown item in the headerTemplate, the Calendar hides #7376

Open
lkuich opened this issue Oct 30, 2024 · 1 comment
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@lkuich
Copy link

lkuich commented Oct 30, 2024

Describe the bug

We're using the headerTemplate prop in the Calendar (using range) to select a year/quarter with a Dropdown, however as of 10.8.4 (working as of 10.8.3), when we select an item from the dropdown, it automatically closes the calendar.

This issue only occurs as of 10.8.4, after a similar fix was put in place to resolve the need to double click outside of the calendar component to close it:
#6920 (comment)

Reproducer

https://stackblitz.com/edit/vitejs-vite-d6qwad?file=src%2FApp.tsx

System Information

System:
    OS: macOS 14.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 120.33 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.9.0/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
  Browsers:
    Chrome: 130.0.6723.91
    Safari: 17.4
  npmPackages:
    primereact: 10.8.4 => 10.8.4 
    react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

  1. Add a calendar component with a dropdown in headerTemplate:
return (
    <div className="App">
      <Calendar
        readOnlyInput
        selectionMode="range"
        headerTemplate={HeaderTemplate}
      />
    </div>
  );

  function HeaderTemplate() {
    return (
      <Dropdown
        options={['2021', '2022', '2023', '2024', '2025']}
        placeholder="Years"
        onChange={() => {}}
      />
    );
  }
  1. Open the Calendar
  2. Select a year option
  3. Observe the whole calendar component closes

Expected behavior

  1. Open the Calendar
  2. Select a year option
  3. Observe the calendar remains open, until explicitly clicking outside of its bounds
@lkuich lkuich added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 30, 2024
@lkuich lkuich changed the title Calendar: 10.8.4 - When selecting a dropdown item in the headerTemplate, the calendar hides Calendar: 10.8.4 - When selecting a dropdown item in the headerTemplate, the Calendar hides Oct 30, 2024
@lkuich lkuich changed the title Calendar: 10.8.4 - When selecting a dropdown item in the headerTemplate, the Calendar hides Calendar: 10.8.4 - When selecting a Dropdown item in the headerTemplate, the Calendar hides Oct 30, 2024
@lkuich
Copy link
Author

lkuich commented Nov 15, 2024

Is there any way we can at least manually control the visibility of the calendar and handle outside clicks ourselves? This is blocking our upgrade from PrimeReact 8 > 10 (previous versions include bugs that prevent us from downgrading).

@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 Nov 15, 2024
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

No branches or pull requests

2 participants