Code Monkey home page Code Monkey logo

Comments (6)

Rekl0w avatar Rekl0w commented on July 21, 2024 1

No, it is weird that i tried almost everything but not works for this. I also tried to use old version of this function but still the same behavior. I guess this is another bug. @melloware

from primereact.

melloware avatar melloware commented on July 21, 2024

cc @Rekl0w

from primereact.

melloware avatar melloware commented on July 21, 2024

it probably needs to be ObjectUtils.isNotEmpty(props.optionValue)

from primereact.

espentveit avatar espentveit commented on July 21, 2024

The case where I tested was for the one with the 'value' key set. Maybe the isNotEmpty should check the output of resolveFieldData?

const getOptionValue = (option) => {
  if (props.optionValue) {
    return ObjectUtils.resolveFieldData(option, props.optionValue);
  } else {
    const optionValue = ObjectUtils.resolveFieldData(option, "value");
    return ObjectUtils.isNotEmpty(optionValue) ? optionValue : option;
  }
};

Edit:
Or maybe use

const getOptionValue = (option) => {
  if (props.optionValue) {
    return ObjectUtils.resolveFieldData(option, props.optionValue);
  } else {
    return option.hasOwnProperty("value") ? ObjectUtils.resolveFieldData(option, "value") : option;
  }
};

from primereact.

Rekl0w avatar Rekl0w commented on July 21, 2024

Both codes causes the blank dropdown options.

image

If you try the old codes before i've changed, it behaves the same. Like i said i don't think that code causes this bug.

from primereact.

espentveit avatar espentveit commented on July 21, 2024

Ok. I'll test some more tomorrow

from primereact.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.