nobbynobbs / react-dadata-suggestions Goto Github PK
View Code? Open in Web Editor NEWJust another one React component for dadata suggestions
Home Page: https://www.npmjs.com/package/react-dadata-suggestions
Just another one React component for dadata suggestions
Home Page: https://www.npmjs.com/package/react-dadata-suggestions
Как передать атрибут id компоненту?
<DadataSuggestions
{...input}
token="***"
placeholder="Введите город"
id= "Тест"
/>
Hello,
Styles for LIQUIDATED companies are not working in react-final-form. Is there any way to fix it?
Here is codesandbox (you can try it with ИНН 110380625809
).
На проекте упёрлись в то, что для некоторых регионов нам не нужны подсказки и, соответственно, запрос к dadata. Попробовали подменить на другой инпут, но тогда слетает каретка (задача отключить подсказки в момент редактирования адреса).
Можем ли мы добавить опцию disableDadata
, чтобы отключить подсказки и запрос к dadata при редактировании?
Hello!
Is it possible to configure deferRequestBy option? As in https://confluence.hflabs.ru/pages/viewpage.action?pageId=207454318 jquery plugin
Добрый день. Скажите, пожалуйста, планируете ли вы добавить поддержку подсказок по ФИАС?
Is there any way to change a class name for the input? May be add it as a prop?
Добрый день.
Скажите, пожалуйста, есть ли в библиотеке возможность указать приоритет города при ранжировании (locations_boost
)? Я попробовала указать приоритет в поле specialRequestOptions
, но мне кажется, что он не срабатывает. Вот ссылка на codesandbox.
A placholder prop for query input should be provided.
Hi there,
Do you have an example of using react-dadata-suggestions
with Formik or Final Form? I tried to do it myself with Final Form, but I can't get it to work. Here is my codesandbox.
Here is a codesandbox for Formik, which is also not working.
Похоже возникает из-за обновления состояния компонента в ответе реквеста, когда самого компонента уже нет.
Hi! Thanks for the great solution for support DaData in React.
But there is a problem with setState inside onSelect:
<DadataSuggestions token={ token } placeholder="Иванов Иван Иванович" service="fio" onSelect={ (suggestion) => { this.setState({person: suggestion}) } } />
When I select a suggestion, the value of input reset to "". What am I doing wrong?
I was told that suggestions list is not "selectable" on iphones (at least on SE and 6).
It is opened, but not "cliсkable" - nothing is selected, list remains open.
On android and desktop (windows) everything is ok. Not tested on Mac yet.
I asked the same users to compare with original dadata jquery suggestions - they say everything is ok there.
Could you please investigate this issue?
В связи с тем, что в Питере есть адреса с литерой и без (подробнее см. здесь), для домов без литеры не определяется код ОКТМО.
В поддержке Дадаты сообщили, что при работе с подсказками необходимо делать как минимум два запроса, это принцип работы сервиса. При первом запросе с count > 1 значение ОКТМО берется из справочника ФИАС → адреса без литеры там нет → ОКТМО нет.
Далее нужно сделать второй запрос с count = 1, то есть выбрать адрес, тогда ОКАТО/ОКТМО появятся для адреса без литеры. Текст запроса должен быть результатом одного из предыдущих запросов (значением поля unrestricted_value).
Как я понимаю, сейчас для адресов выполняется только один запрос. Не могли бы вы добавить при выборе адреса второй запрос с count = 1?
На мобильных устройствах невозможно выбрать значения, которые показываются в всплывающем окне подсказок. Как можно решить данную проблему?
There is a warning for created input element.
Is it possible to get location data on API creation?
I mean return of location data on detectAddress()
in FetchApi
Добрый день.
Скажите, пожалуйста, можно ли передать input
дополнительные параметры, например,
tabIndex="0" data-select data-name={input.name}
?
Выпадалка с подходящими вариантами сейчас размещается в том же контейнере. Это не всегда удобно, если родительские элементы имеют ограничение по overflow.
Планируется ли возможность размещения выпадалки в body и абсолютное позиционирование ее относительно инпута?
Или как сейчас решить эту проблему?
Hello,
I'm using react-dadata-suggestions with react-final-form (RFF) as a custom component. RFF has some FieldRenderProps, which can be used with inputs. I'm using input.value
and meta.active
to define label classes like this:
const labelClasses = classnames(
"input-label",
{
"input-label--active": input.value !== "" || meta.active
},
className
);
In case with DadataSuggestions input.value
works, but meta.active
(which shows whether or not the field currently has focus) doesn't.
Here is a codesandbox. Currently address input doesn't get input-label--active
class onFocus, but only when there is some value.
(There is also an example of another custom component, where both input.value
and meta.active
work.)
Is there anyway to fix it?
Is it possible to use bounds
param for address suggestions?
Like here:
Hi there,
I have one more question about using react-dadata-suggestions
with react-final-form
.
I would like to initialize the form with some data from the state. When I do it, all the fields are working, except the input with react-dadata-suggestions
. Here is an example.
Is there any way I can fix it?
При настройке тревиса выяснилось, что в npm все время выкладывалась девелоперская сборка пакета. Теперь выкладывается нормальная, но в ней js отдельно, стили отдельно, поэтому css нужно подключать явно, см. README.
Извиняюсь за такие фокусы в патч версии.
Hello,
How can I add css styles for highlighted words? I can't find corresponding class in styles.
Здравствуйте, я использую поле для ввода email адреса, но проблема в том что email у меня находится в форме, как и все остальное. Я как всегда пытался связать все это дело через контроллер, но почему-то onChange не видит value и значение туда не передается как я понял.
<Controller control={control} name="email" onChange={ (event) => setEmail(event.target.value) } rules={{ required: true, minLength: 1, maxLength: { value: 50, message: "*Почта слишком большая", } }} render={({ field: {onChange, onBlur, value} }) => <> <DadataSuggestions token="token" onSelect={ (suggestion) => console.log(suggestion) } service="email" count={5} onBlur={onBlur} onChange={ (event) => onChange(event.target.value) } // проблема вся вот в этой строчке /> </> } />
I tried to import package into my project but module was not found.
By the way, main
from package.json
is related to dist/index.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.