Make ui.input's autocomplete usable on mobile phone #852
Replies: 7 comments 19 replies
-
This doubt arose in your code review, and @falkoschindler too, and while I was fixing the code. The question is, wouldn't this affect any |
Beta Was this translation helpful? Give feedback.
-
Or we can maybe leverage the built-in HTML5 datalist element and the autocomplete attribute somehow? |
Beta Was this translation helpful? Give feedback.
-
ChatGPT also suggested a combination of QInput, QSelect and QVirtualScroll. Something like this: <template>
<div>
<q-input
v-model="userInput"
@input="filterSuggestions"
label="Search"
filled
></q-input>
<q-select
v-if="filteredSuggestions.length > 0"
filled
options-dense
use-input
v-model="userInput"
:options="filteredSuggestions"
behavior="dialog"
@filter="filterSuggestions"
>
<template v-slot:before>
<q-virtual-scroll
:items="filteredSuggestions"
:item-height="40"
:items-size="filteredSuggestions.length"
class="col-auto"
>
<template v-slot="{ item, index }">
<q-item clickable @click.stop="userInput = item">
<q-item-section>{{ item }}</q-item-section>
</q-item>
</template>
</q-virtual-scroll>
</template>
</q-select>
</div>
</template> |
Beta Was this translation helpful? Give feedback.
-
My intention was to implement something simple that would give a little extra. What do you think of a slot with an icon that appears along with the shadow-text? maybe too cumbersome.. |
Beta Was this translation helpful? Give feedback.
-
With "keypress.enter" seems to work without any problems: from nicegui import ui
def work():
ui.notify('Some other task done')
options = ['Awesome', 'NiceGUI', 'AbCdE']
ui.input(autocomplete=options).on('keydown.enter', work)
ui.run() |
Beta Was this translation helpful? Give feedback.
-
After considering @phoskee's PR #879, which runs a JavaScript function for every |
Beta Was this translation helpful? Give feedback.
-
This feature has been implemented in PR #1063. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the autocomplete feature of ui.input is unusable on mobile phone. What could be a good technique if there is no TAB button pressable?
Beta Was this translation helpful? Give feedback.
All reactions