Comments (14)
Hi! I'm not sure, but probably I work wrong with context in callback functions in my component. I'll think about this issue.
from react-dadata-suggestions.
I found workaround already :-)
<DadataSuggestions token={ token } placeholder="Иванов Иван Иванович" query={this.state.query} onChange={(query) => this.setState({query: query}) } service="fio" onSelect={ (suggestion) => { this.setState({person: suggestion} ) } } />
from react-dadata-suggestions.
so can i close the issue?
from react-dadata-suggestions.
I think yes
from react-dadata-suggestions.
I thimk this should be reopened.
from react-dadata-suggestions.
@SDKiller maybe. But could you explain why?
from react-dadata-suggestions.
from react-dadata-suggestions.
from react-dadata-suggestions.
You could use query
option to initialize query string, see Address example at https://codesandbox.io/s/p95804280q
I think it fits your case.
from react-dadata-suggestions.
Thanks for example, if I initialize it via query - I got not editable field, I'll try to find what I'm doing wrong.
from react-dadata-suggestions.
@nobbynobbs
Could you please suggest, how onSelect
to send one more query with unrestricted_value
and count
1?
The problem is that suggestions are returned with empty geo_lat
and geo_lon
.
According to today's answer of dadata support:
Подсказки возвращают координаты после того, как человек выбрал конкретный адрес из списка.
В API это запрос с параметром count = 1. При этом текст запроса должен быть результатом одного из предыдущих запросов (значением поля unrestricted_value). Например:
{ "query": "г Москва, ул Сухонская, д 11", "count": 1 }
from react-dadata-suggestions.
@SDKiller I'm afraid react-dadata-suggestion can't do such query for you. You could make this query manually in onSelect callback with fetch-api or axios.
from react-dadata-suggestions.
from react-dadata-suggestions.
Not at all
from react-dadata-suggestions.
Related Issues (20)
- Возможность отключить suggestions HOT 1
- Не работают touch ивенты HOT 2
- Why `dist` directory is not in repo? HOT 2
- breaking changes в версии 1.0.3
- Using react-dadata-suggestions with Formik or react-final-form HOT 19
- Add a class name to the query input HOT 4
- Get location data HOT 1
- Problem with extracting onFocus event HOT 4
- How to add styles for suggestion highlighting HOT 4
- Styles for LIQUIDATED are not working HOT 5
- Initializing react-dadata-suggestions with data from the state HOT 24
- Выпадалка в body HOT 2
- Возможность указать приоритет города HOT 2
- Возможность передать input дополнительные параметры HOT 10
- Warning: Invalid DOM property `autocomplete`. Did you mean `autoComplete`? HOT 1
- Как передать атрибут id компоненту HOT 3
- Поддержка подсказок по ФИАС HOT 1
- `bounds` prop HOT 2
- Проблемы с определением ОКТМО для адресов в Санкт-Петербурге HOT 6
- Как связать эту библиотеку с useForm? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-dadata-suggestions.