primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.84k stars 1.04k forks source link

Calendar: Global esc key listener with priority [600, 0] already exists #7220

Closed marengga closed 1 month ago

marengga commented 1 month ago

Describe the bug

I encountered an issue when using two Calendar components on the same page as time pickers. The error appears after selecting time in first calendar and move the focus to second calendars. This issue happens when the Calendar component is used as a time picker, not only as a date picker.

Error: Unexpected: global esc key listener with priority [600, 0] already exists. I believe the error is related to the useGlobalOnEscapeKey hook, which may be misconfigured or have a bug affecting the Calendar component's behavior.

Reproducer

https://stackblitz.com/edit/stackblitz-starters-tuzydi?file=app%2Fpage.tsx

System Information

System:
    OS: macOS 14.6.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 593.41 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.2.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.2.4 - /usr/local/bin/npm
    Watchman: 2023.11.20.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 128.0.6613.138
    Safari: 17.6
  npmPackages:
    primereact: ^10.8.3 => 10.8.3 
    react: ^18 => 18.2.0 
    tailwindcss: ^3.3.0 => 3.4.0

Steps to reproduce the behavior

  1. Select a start time in the first Calendar component.
  2. Without pressing any keys or clicking elsewhere, select an end time in the second Calendar component. An error occurs at this point.

Expected behavior

The calendars should function independently as time pickers without triggering any errors.

melloware commented 1 month ago

@avasuro interested in looking into this one?

ozantekin commented 1 month ago

@avasuro interested in looking into this one?

I’ve submitted a PR to address this issue. @melloware

noeesparsa commented 1 month ago

Hello @melloware ! Do you know when it will be available ? or when next version will be published with this fix ?

melloware commented 1 month ago

@noeesparsa i don't have any insight when PrimeTek does releases. Hopefully soon?

sebasdeweert commented 3 weeks ago

Hi @melloware, will this bug be fixed in the newest version of primereact 10.8.4?

melloware commented 3 weeks ago

Yes it will. Whenever 10.8.4 gets released...