Code Monkey home page Code Monkey logo

react-dadata-suggestions's People

Contributors

loginovma avatar nobbynobbs avatar sinxwal avatar volosojui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-dadata-suggestions's Issues

Возможность отключить suggestions

На проекте упёрлись в то, что для некоторых регионов нам не нужны подсказки и, соответственно, запрос к dadata. Попробовали подменить на другой инпут, но тогда слетает каретка (задача отключить подсказки в момент редактирования адреса).

Можем ли мы добавить опцию disableDadata, чтобы отключить подсказки и запрос к dadata при редактировании?

The value is reset to "" when using setState

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?

Suggestions cannot be selected on iphone

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?

Не работают touch ивенты

На мобильных устройствах невозможно выбрать значения, которые показываются в всплывающем окне подсказок. Как можно решить данную проблему?

Get location data

Is it possible to get location data on API creation?
I mean return of location data on detectAddress() in FetchApi

Выпадалка в body

Выпадалка с подходящими вариантами сейчас размещается в том же контейнере. Это не всегда удобно, если родительские элементы имеют ограничение по overflow.

Планируется ли возможность размещения выпадалки в body и абсолютное позиционирование ее относительно инпута?

Или как сейчас решить эту проблему?

Problem with extracting onFocus event

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?

Initializing react-dadata-suggestions with data from the state

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?

breaking changes в версии 1.0.3

При настройке тревиса выяснилось, что в npm все время выкладывалась девелоперская сборка пакета. Теперь выкладывается нормальная, но в ней js отдельно, стили отдельно, поэтому css нужно подключать явно, см. README.

Извиняюсь за такие фокусы в патч версии.

Как связать эту библиотеку с useForm?

Здравствуйте, я использую поле для ввода 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) } // проблема вся вот в этой строчке /> </> } />

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.