PickList - Selection Change properties throw errors
Hi, I would like to report a bug. In the documentation for the component PickList, there are two properties for SelectionChange events.
onSourceSelectionChange and onTargetSelectionChange are the properties.
When you feed in a method into these properties it throws the error below.
Cannot read properties of null (reading 'length')
DEMO https://codesandbox.io/s/recursing-wright-erddje?file=/src/demo/PickListDemo.js:2325-2348
This is what my PickList looks like. It's straight out of the demo.
<PickList source={source} target={target} itemTemplate={itemTemplate} sourceHeader="Available" targetHeader="Selected" sourceStyle={{ height: "342px" }} targetStyle={{ height: "342px" }} onChange={onChange} filterBy="name" sourceFilterPlaceholder="Search by name" onTargetSelectionChange={SelectionChange} />
And this is what my SelectionChange method looks like...
const SelectionChange = (s) => { console.log("Clicked!"); };
It's very simple, and is straight from the demo. But it simply does not work. These properties are well documented in the prime faces documentation. https://www.primefaces.org/primereact/picklist/
-Paul
Confirmed thanks for the reproducer. Will look into it.