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

PickList - Selection Change properties throw errors #3147

Closed
palkema opened this issue Aug 8, 2022 · 1 comment · Fixed by #3157
Closed

PickList - Selection Change properties throw errors #3147

palkema opened this issue Aug 8, 2022 · 1 comment · Fixed by #3157
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@palkema
Copy link

palkema commented Aug 8, 2022

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

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. 👍 confirmed labels Aug 9, 2022
@melloware
Copy link
Member

Confirmed thanks for the reproducer. Will look into it.

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

Successfully merging a pull request may close this issue.

3 participants