Giter VIP home page Giter VIP logo

Comments (9)

TrevorBurnham avatar TrevorBurnham commented on July 20, 2024 1

So you're changing opts in the onInputKeyDown handler?

Instead of using options and onInputKeyDown, have you considered using loadOptions? That's the official mechanism for supplying options asynchronously in response to the user's search query.

from react-select-plus.

TrevorBurnham avatar TrevorBurnham commented on July 20, 2024

What's going on in that onInputKeyDown handler? If you remove that line, does the Select behave normally?

from react-select-plus.

alrms avatar alrms commented on July 20, 2024

When i gave an input from my keyboard a service is called through redux saga. Am i missing a property and my list is not refreshed? It looks like even if my state is updating the list is not updating instantly. Only after onBlur and then onFocus the list is updating

from react-select-plus.

alrms avatar alrms commented on July 20, 2024

Hmm nice thought Trevor. I'm gonna give it a try and i 'll inform you. Close the issue if you wish to and i'm going to inform you if this approach will properly :)

from react-select-plus.

alrms avatar alrms commented on July 20, 2024

I've change the options to loadOptions. Now the list is not rendering at all

from react-select-plus.

TrevorBurnham avatar TrevorBurnham commented on July 20, 2024

What does your loadOptions function look like?

from react-select-plus.

alrms avatar alrms commented on July 20, 2024

My loadOptions is exactly the same as my options function beacause when the service is called i save my state with the exact same way:
const clientsIdArray = Array.from(clients.keys());

const opts = clientsIdArray.map((client) => {
  const lastName = clients.getIn([client, 'lastName']);
  const exchangeCode = clients.getIn([client, 'exchangeCode']);
  const customer = `${lastName}(${exchangeCode})`;
  const portArray = clients.getIn([client, 'portfolioCode']).toArray();
  if (portArray.find(i => i.includes('#'))) {
    portArray.push(portArray.splice(portArray.indexOf(portArray.find(i => i.includes('#'))), 1)[0]);
  }
  const typesArray = [];
  for (let i = 0; i < portArray.length; i += 1) {
    typesArray[i] = portfolios.getIn([portArray[i], 'type']);
  }
  const finalTypesArray = typesArray
    .filter(value => value !== undefined);
  if (finalTypesArray.includes('DERIV')) {
    finalTypesArray.push(finalTypesArray.splice(finalTypesArray.indexOf('DERIV'), 1)[0]);
  }
  return {
    label: customer,
    value: client,
    options: finalTypesArray.map((value, i) =>
      ({ label: value, value: portArray[i] }))
  };
});

and then optios ={opts} or loadOptions={opts}

from react-select-plus.

alrms avatar alrms commented on July 20, 2024

You can chech a same issue as mine. He is not using loadOptions as i see https://stackoverflow.com/questions/43072867/use-async-react-select-with-redux-saga

from react-select-plus.

TrevorBurnham avatar TrevorBurnham commented on July 20, 2024

I don't know how to help you. React Select is not a pure component. It may be fundamentally incompatible with redux-saga, unless you can interact with redux-saga through loadOptions.

from react-select-plus.

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.