# Autocomplete also for empty Input elements

**URL:** <https://discourse.nodered.org/t/autocomplete-also-for-empty-input-elements/60800>\
**Category:** Developing Nodes\
**Created:** [4 April 2022 23:30 UTC](https://discourse.nodered.org/t/autocomplete-also-for-empty-input-elements/60800 "2022-04-04T23:30:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hypnos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hypnos/32/7566_2.png) [@Hypnos](https://discourse.nodered.org/u/Hypnos)\
**Post date:** [4 April 2022 23:30 UTC](https://discourse.nodered.org/t/autocomplete-also-for-empty-input-elements/60800/1 "2022-04-04T23:30:40Z")

</div>

I just added autocomplete to a node in a typed input field.

Unfortunately, I noticed that the feature only works if the user enters at least one letter.

It would be great if this could also work when the field is empty, so that the complete list is then available for selection.

Maybe there is a way to achieve this?

If this is not available it could be added to the backlog. (For compatibility reason this could be activated by an additional parameter to the search function.)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 April 2022 05:58 UTC](https://discourse.nodered.org/t/autocomplete-also-for-empty-input-elements/60800/2 "2022-04-05T05:58:06Z")

</div>

This is already in the issue tracker...

> <https://github.com/node-red/node-red/issues/3479>
>
> \### Current Behavior
> 
> Node-RED \[\`autoComplete\` input widget\](https://nodered.org…/docs/api/ui/autoComplete/) has a \[\`search\`\](https://nodered.org/docs/api/ui/autoComplete/#options-search) option defines a callback when searching for a value.
> 
> If the search \`value\` \[is empty\](https://github.com/node-red/node-red/blob/master/packages%2Fnode\_modules%2F%40node-red%2Feditor-client%2Fsrc%2Fjs%2Fui%2Fcommon%2FautoComplete.js#L75-L80), \*\*search is never called\*\*, making it impossible to display some kind of default value
> 
> \### Expected Behavior
> 
> User has control over search when search \`value\` is empty when pressing a submit key (\`Enter\`).
> 
> \### Steps To Reproduce
> 
> 1. Go to Node-RED \[autoComplete\](https://nodered.org/docs/api/ui/autoComplete/#examples) widget examples
> 2. Focus the autoComplete input, or press \`Enter\`
> 3. Notice that no options appear (and there is no way for them to show)
> 
> \### Example flow
> 
> \_No response\_
> 
> \### Environment
> 
> \- Node-RED version: 2.2
> \- Node.js version: 16
> \- npm version: 6.14
> \- Platform/OS: MacOS
> \- Browser: Chrome 99

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 April 2022 05:58 UTC](https://discourse.nodered.org/t/autocomplete-also-for-empty-input-elements/60800/3 "2022-04-19T05:58:17Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
