T
T
T4-1002015-04-20 18:57:12
Yandex maps
T4-100, 2015-04-20 18:57:12

How to catch the value of the selected hint in SuggestView when working with Yandex.Maps?

I try to catch through the select event - nothing comes out

<input class="search__input js__search-value" id="suggest-view" type="search" value="" placeholder=""/>

var suggestView = new ymaps.SuggestView('suggest-view');

suggestView.events.add('select', function (e) {
      console.log('select');
});

The goal is to do it like on the maps https://maps.yandex.ru , so that when you select a hint through the arrows, the hint gets into the input. The select event fires only when the user clicks on the tooltip.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
forgotten, 2015-04-20
@isawillbenice

Something like this
https://jsfiddle.net/u9k68dw7/1/
You can add more timeouts to rebuild the panel when the user lingers on the result, say, longer than 200 ms.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question