Hello,
I followed ticket Question T2789 and tried to create custom autocomplete question. No errors are shown, but question does not appear at all.
Here is sandbox: https://codesandbox.io/s/wonderful-benji-gr6fxy?file=/src/dropahead.jsx
thank you so much!
Denis
Hello Denis,
The mentioned ticket uses an outdated approach. In a most recent version, it is necessary to import
ReactQuestionFactory
from "survey-react-ui" andimport { ReactQuestionFactory } from "survey-react-ui"; import { Serializer } from "survey-core";
You can find an example for the most recent SurveyJS library version in the following demo: React Select as a Drop-Down Editor.
Meanwhile, please let me clarify your overall task. Do you wish to implement a kind of an auto-complete drop-down?
Sure.
The react app I am working on is suppose to work offline for some time without any network access and uses large dictionaries.
Upon the start I download three large tables ~25 Mb overall and push them into Chrome's Indexed DB.
So I want Autocomplete functionality on a dropdown: once user typed at least three symbols I run a search in Indexed db to present him list of choices(tables are ~150K records each so this is the only way ).
Your out of the box dropdown component has something similar but it issues an ajax call, where as my app works offline. I also tried lazy loading but no luck.
Thank you for the clarification, Denis. Implementing a custom drop-down from scratch is not a trivial task. I would recommend the lazy loading feature: the onChoicesLazyLoad function allows you to fetch items and push them to a drop-down item list. However, it seems you've already tried it. Would you please clarify why it doesn't work for you?
Oh not from scratch. I actually already achieved what I wanted more or less… https://codesandbox.io/s/wonderful-benji-gr6fxy?file=/src/dropahead.jsx
Your recommendation for proper Imports made the whole thing to work.
thank you
Thank you for the update, Denis. I'm happy to hear that this recommendation helped.
Please drop us a line if you have any questions.