I am using Mapbox autofill. When a user types some address that doesn't exist like in the picture.
Then he clicks enter to autofill the full address with the suggestion. The suggestion this way is undefined and error will be thrown:
Uncaught (in promise) Error: suggestion is required.
Through debugging I found this is the place where error happens.
I would like to handle it so I could provide the user with some toast message/notification asking him to fill whole address. Leaving it just in the console would be ugly.
I know that there are 3 events that come from autobox and can be handled through eventlistener.
None of them is triggered if the aforementioned error is thrown, even when I was expecting that at least on 'suggesterror'.
Any ideas on how I can catch this error? It seems to be visible in console even on the official example as they are not handling it.