primefaces / primereact

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

Inplace: active prop does not work #6940

Closed Vilican closed 1 month ago

Vilican commented 1 month ago

Describe the bug

active property does not work - changes are not reflected in the component

Reproducer

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

System Information

  System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor            
    Memory: 13.76 GB / 31.91 GB
  Binaries:
    Node: 20.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.3.1 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    primereact: ^10.7.0 => 10.7.0
    react: ^18.3.1 => 18.3.1

Steps to reproduce the behavior

  1. Click on the Inplace
  2. Observe that nothing is logged in the console
  3. Try to close the Inplace via the X button
  4. Observe that nothing happens or is logged in the console

Expected behavior

No response

melloware commented 1 month ago

I fixed your stackblitz: https://stackblitz.com/edit/vitejs-vite-pcxo9u?file=src%2FApp.tsx

The docs need to be updated. The active flag is only use in controlled mode when used with onToggle.

const active = props.onToggle ? props.active : activeState;
melloware commented 1 month ago

I will add a showcase example for this. Thanks for reporting!