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

Feat #6589 return option when optionValue is empty #6627

Conversation

KirilCycle
Copy link
Contributor

@KirilCycle KirilCycle commented May 15, 2024

Defect Fixes

Fix #6589

Similar to primevue, returns the entire option object if the desired optionValue is missing

Copy link

vercel bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview May 15, 2024 0:56am
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview May 15, 2024 0:56am

@KirilCycle KirilCycle changed the title feat/ return option when optionValue is empty Feat #6589 return option when optionValue is empty May 15, 2024
@melloware
Copy link
Member

cc @Rekl0w i don't think this is the correct fix.

@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label May 15, 2024
@Rekl0w
Copy link
Contributor

Rekl0w commented May 15, 2024

No it's not. It's reverting this fix #6518 @melloware

@melloware melloware closed this May 15, 2024
@sja-cslab
Copy link
Contributor

I'm confused now.
#6518 is about optionLabel as your fix in #6520
but this fix here is about optionValue.

@Rekl0w
Copy link
Contributor

Rekl0w commented May 16, 2024

Same fix applied for optionLabel too.

@melloware
Copy link
Member

@sja-cslab you can see label and value do the same things..

        const getOptionLabel = (option) => {
            return props.optionLabel ? ObjectUtils.resolveFieldData(option, props.optionLabel) : ObjectUtils.resolveFieldData(option, 'label') || option;
        };

        const getOptionValue = (option) => {
            return props.optionValue ? ObjectUtils.resolveFieldData(option, props.optionValue) : ObjectUtils.resolveFieldData(option, 'value') || option;
        };

@sja-cslab
Copy link
Contributor

@melloware sure I noticed that but thought @Rekl0w tried to roll that back - just asking because that would fix the issue #6589 I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropdown: Init-Value not working if options have label,value properties
4 participants