Question

1
Replies
231
Views
Maxim Izvarin (MaximI83)
Alfa Bank

Alfa Bank
RU
MaximI83 Member since 2018 16 posts
Alfa Bank
Posted: April 26, 2019
Last activity: August 16, 2019
Posted: 26 Apr 2019 8:27 EDT
Last activity: 16 Aug 2019 11:35 EDT
Closed

Custom autocomplete cant select on mobile device

Hello

I made a custom control to display hints when entering an address into an input and decomposing the full address into parts (Oblat, City, Street, etc.). Decomposition occurs when you click on one of the suggested autocomplete options after that values set in text fields. On the PC, everything works well, but when running on a mobile device and selecting one of the options, the value is not written to the fields for decomposition. Below is a sample of the code. We get hints from the external service when the API is connected to our application. Please tell me what the problem may be

$("[Data-test-ID = 'Input_Address']").suggestions({
token: "API key here",
type: "ADDRESS",
count: 5,

onSelect: function(suggestion) {
console.log(suggestion);

$("[Data-test-ID = 'Full1']").val(suggestion.unrestricted_value);
$("[Data-test-ID = 'Flat1']").val(suggestion.data.block);
$("[Data-test-ID = 'City1']").val(suggestion.data.city);
if (suggestion.data.city == null)
{
$("[Data-test-ID = 'City1']").val(suggestion.data.settlement);
}
$("[Data-test-ID = 'Street1']").val(suggestion.data.street);
$("[Data-test-ID = 'House1']").val(suggestion.data.house);
$("[Data-test-ID = 'Region1']").val(suggestion.data.region);
$("[Data-test-ID = 'postal_code1']").val(suggestion.data.postal_code);
$("[Data-test-ID = 'ID1']").val(sek);

}
});

Low-Code App Development Enterprise Application Development Dev/Designer Studio Mobile
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.