Giter VIP home page Giter VIP logo

Comments (5)

bendenoz avatar bendenoz commented on April 28, 2024 1

That's interesting... I guess I was confused by the fact it was almost working out of the box with ReferenceArrayInput too. They almost provide the same context...
Anyway it works fine with ReferenceInput, thanks !

from react-admin.

slax57 avatar slax57 commented on April 28, 2024

Thank you for this report and for the investigation work.

Can you please provide a reproduction sandbox (forked from https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple or https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple ) so that we can investigate the issue ?

Also, can you please confirm you are using an AutocompleteArrayInput as child of ReferenceArrayInput and not a simple AutocompleteInput?

I'm wondering because of this sentence in your report:

Specifically, AutocompleteInput returns a string value (unlike AutoCompleteArrayInput), while useReferenceArrayInput expects an array.

from react-admin.

bendenoz avatar bendenoz commented on April 28, 2024

Thanks @slax57. No I am using AutocompleteInput for a single entry, not the Array variant. It's used in a filters component. It works fine except when the choices are not present in the list.
I will try to make a simple repro sandobx

from react-admin.

bendenoz avatar bendenoz commented on April 28, 2024

Here is the sandbox

https://codesandbox.io/p/devbox/funny-firefly-p64lgt?file=%2Fsrc%2FdataProvider.tsx%3A42%2C43

I cannot repro 100% (could be a cache problem) but it is still possible to demonstrate the issue. In our cases, the input is empty even before reloading.

1/ Working example: Add Tags filter. Click the input wait for the list to populate, select "Sport" . Only Sport posts are shown. Reload the page (the whole sandbox), the Sport filter is still working

2/ Broken example: Add Tags filter, Click the input, type "mu", wait for the list to populate, select "Music". Only Music posts are shown. Reload the page (the whole sandbox). The Music filter is still working but the Tags input is empty

Actual:

image

Expected:

image

from react-admin.

slax57 avatar slax57 commented on April 28, 2024

Thanks for the sandbox.

If you are using ReferenceArrayInput the child should be an AutocompleteArrayInput. If you are expecting a single entry, you should be using a ReferenceInput with an AutocompleteInput child.

Am I missing something?

from react-admin.

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.