Customize autocomplete field to show children terms depending on another field I have a taxonomy with 2 levels

City1
-Park1
-Park2
-Park3 
City2
-Park4
-Park5
-Park6


In my form, I created a field that links to this taxonomy with an autocomplete widget. I also have a second field where the user chooses the city.

I would like to dynamically change the autocomplete value depending on the selected city. Which means if the user selects City1, the autocomplete will only filter through the values under City1.

After checking the form I've found that the widget entity_autocomplete have an attribute #selection_handler. Will it be possible to change this handler and somehow send the value of the selected city?

I think there should be an easier approach. Creating a custom autocomplete field based on a textfield doesn't seem like a good solution since it will not have (or I will need to do it manually) all the error handling and entity links.

Any suggestions ?
You can drop using entity_autocomplete and instead it use custom autocomplete field. Here is an example of using, you can translate this page from Russian to your language. Also the example contains the attached source files. 

https://niklan.net/blog/77

In the example you can see a controller what creates the list with values.
I suppose that you can pass a parameter to the controller (city_id) and SQL query will return set of resuts according the parameter.

You can add the parameter to the controller inside function buildForm() of your form. Also you can recreate the autocomplete element with new parameter after you selected a city from the list.