cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kumar9024021
Level: Powered On

Issue with autocomplete textbox - Resultbox should only show, when I type-in

I am using auto-complete feature on the textbox. The autocomplete results should only show, when I start typing some words in the textbox. When there is no match, the auto-complete results textbox should hide automatically.

 

Hence, in the textbox OnChange and OnSelect, I am setting the Gallery visibility to true.

UpdateContext({showgalleryflag:true});

 

In the Gallery OnSelect, I am setting back the Gallery visibility to false

UpdateContext({showgalleryflag:false});

 

Scr2.PNG

 

The problem with above code is, even when I haven't keyed-in anything in the textbox, the auto-complete empty resultbox appears, because OnSelect of textbox I have set the Gallery visibility to true.

 

If I remove the OnSelect textbox property and only have OnChange textbox property, the auto-complete resultbox doesn't appear unless i click anywhere outside the textbox, which shouldn't be the case. Autocomplete results should appear when there is a match when i type-in.

 

Anyway to tackle this behaviour would be helpful. Thanks.

 

 

 

 

 

4 REPLIES 4
Kumar9024021
Level: Powered On

Re: Issue with autocomplete textbox - Resultbox should only show, when I type-in

Hi @yashag2255 ,

 

Is there anyway, where we can only show the autocomplete resultbox only when we type-in. OnChange doesn't work here, because I have to click outside my textbox, which in-turn shows the autocomplete resultbox. OnSelect will show, even before i type-in

Scr2.PNG

 

Microsoft v-siky-msft
Microsoft

Re: Issue with autocomplete textbox - Resultbox should only show, when I type-in

@Kumar9024021,

 

Do you mean the gallery only shows when the entered text matched the value?
Have you tried to modify the filter function in Items property of gallery as below? use "=" instead of "in".

Filter('DataSource', Value = TextInput1.Text)

Sik

Kumar9024021
Level: Powered On

Re: Issue with autocomplete textbox - Resultbox should only show, when I type-in

No, The autocomplete resultbox gallery only shows, when I have clicked outside the textbox, because OnChange I have set the showgalleryflag to true.

 

1. OnChange would work only when I clicked outside the text-area.

2. If I use OnSelect, Gallery would show even before typing in any keyword.

 

Auto-Complete results should popup, when I have keyed-in 3 words in textbox and if there is a match. If not, Gallery shouldn't show.

 

Gallery Items property is

If(
!IsBlank(DataCardValue5.Text),
Filter('DS',
StartsWith(Name,DataCardValue5.Text)
)
)

 

 

 

 

Microsoft v-siky-msft
Microsoft

Re: Issue with autocomplete textbox - Resultbox should only show, when I type-in

@Kumar9024021Got you.

You want the Result gallery shows when you have entered a text that matches one of the results, right?

Just modify the Visible property of Gallery, make a prerequisite for the input text to match the result

 

If(TextInput1.Text in Col_choices.Value ,ShowAssignedToGallery)

 

Sik

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,393)