Have enabled Geo location and added a 'Address input component (Preview)' input into a app.
The address auto-fill works great but I can't figure out what command to add to a reset button to clear it back to blank.
It's part of a form with some hidden fields that pull aspects of the address which works great but because i can't clear/reset it the fields won't clear either.
Manually entering and deleting the text isn't really a great workaround.
Anyone come across this or have a solution?
Here we are in 2022 almost 2 years later, and they have done nothing to address this.
The best and easiest hack fix is to navigate to a BLANK screen with an auto starting timer set for a duration of 1. Set the OnTimerStart = Navigate(YourScreen), where it goes back to the screen with the AddressInput Control. for the AddressInput.OnAddressSelect write the data out to a collection then immediately navigate to the blank screen.
The act of switching screens clears out the AddressInput field. The data is keept in the collection to use how you need.
Example attached and see video
I would be very interested in your solution, but I don't quite understand how I have to implement it now. Could you please explain it to me in more detail?
Thanks a lot
I have tried your solution and it works very well in principle.
Thank you very much for that.
Unfortunately, I have in my case but a rather specific problem 😉
I have built a route planner into my app to calculate the distance between two cities.
That is, I have on one screen equal to two address inputs for start and destination address, which I want to reset each with a separate button. Unfortunately it always resets both address inputs.
Do you see a way to prevent this?
I would be grateful for any tip.
IMO this requires Microsoft to actually implement the functionality to see the control as a resettable control. There is no hack that will fix the need for a feature in this use case. I tried. I made a component out of the control, thinking I could trick the component into refreshing at the component level like I did with the the screen, but had no luck.
@aprildunnam any chance you can get the right folks at MSFT to bubble up this long standing missing feature. It's something that really is so basic and rooted into a controls base functionaly that its hard to beleive this is missing. Much thanks April.
For controls that don't support Reset(), the solution is usually to use a variable or collection (depending on the control type) for the Default: property and reset that instead.
As most have already indicated, for many controls this is quite painful and for some, just plain impossible.
For the address input control, I use a clear button (The "X" you normally see on a text input if you enable the clear button) which I create manually from a button and place over the end of the address input. With proper styling and padding of the input, it fits seamlessly.
Then I set the Default: of the address input to a variable, and when I push the clear button, set the variable to "", which seems to work fine for me. I also use the variable to hold the output details of the address input so I can plot them on the map control, so it all works quite well.
All said and done, the Address Input is an input and has a first-loaded state to which it should be able to return to on Reset...but this for me is the most elegant reset workaround.
Thanks for your feedback, but I don't quite understand your solution yet.
For both Address Inputs I have nothing under the Default properties (only two quotation marks).
Where exactly do you set the variable and how should it look like ?
The rest I have understood so far.