Search code examples
searchodatasapui5autosuggest

SAPUI5 search field auto suggestion on mobile device


I am using the solution of

SAPUI5 Search Field Suggestion Autocomplete

with the attachEventOnce(), which works very good with OData. now my issue is, when after the auto suggestions are visible and user hits one of the results, the search gets triggerd but also the auto suggestion gets triggered again and the focus of the auto suggestion is back in fullscreen (with mobile device). so the user must close the auto suggestion to see the results in my list. any ideas how to avoid this?

i would like to have, that after the user taps on an auto suggested result, the search gets triggered and the the auto suggestion gets closed.


Solution

  • Found a working solution by myself: when hitting the search event I remove the suggestion property of the searchfield. this worked before but then the suggestions were gone and I could not figure out how to bring them back. now i add an event listenter to the searchfield which listens to the click event. in this event I just set the suggestions property back to true.