Dropdowns which depend on choice of the first dropdown don't update while using st.form

Dear all,
as I am relatively new to Streamlit, I’m struggling with some of its functionalities. I am trying to use st.form(s), as my app has a lot of graphs and difference options.
I have 3 st.selectbox, where second and third depend on what the user chooses in the first one. Everything is fine and works perfectly well, until I put it to the form, to separate it from other components on the page. When the drop downs are in the form, 2nd and 3rd ones won’t show appropriate list until I press the Submit button.
My goal is to choose the data set from the 1sr st.selectbox, then dependent axes x and y and then, by pressing the submit button, to plot the graph. But I can’t manage to do that.

I would appreciate some hints how to implement it, because not having the forms make the app very slow.
Thanks in advance.

Here is a part o my code:

with st.form('Set_display_graph1'):
	with st.beta_container():
		st.header('Visualisation XY')
		col1, col2 = st.beta_columns((1, 4))

		list_df1 = ['Complète', 'Manoeuvre', 'Effort']
		chosen_df1 = col1.selectbox('Choisir base de données pour graphe 1:', list_df1)

		if chosen_df1 == 'Complète':
			if mychoise == 'bar1':
				list_x1_values = ['Position vsup RG (m)', 'Position vsup RD (m)', 'Couple RG (kNm)',
								  'Couple RD (kNm)']
				list_x1_values = ['Effort Vsup RD (t)', 'Effort Vsup RG (t)', 'Effort Vinf RD (t)',
								  'Effort Vinf RG (t)']

			list_x1_keys = tmp.columns.to_list()
			list_y1_keys = tmp.columns.to_list()
			list_y1_values = list_x1_values

		elif chosen_df1 == 'Manoeuvre':
			list_x1_keys = df_len_manoeuv.columns.to_list()
			list_y1_keys = df_len_manoeuv.columns.to_list()
			if mychoise == 'bar1':
				list_x1_values = ['Temps de debut', 'Temps de fin', 'Duration manoeuvres (s)',
								  'Duration manoeuvres (h:m:s)',
								  'Manoeuvres numero', 'Position RG au debut']
				list_x1_values = ['Manouevre vsup num', 'Temps de debut vsup', 'Temps de fin vsup',
								  'Duration manoeuvre vsup', 'Position vsup debut', 'Position vsup fin']
			list_y1_values = list_x1_values

			if mychoise == 'bar1':
				list_x1 = ['Reference position (m)']
				list_x1_values = ['Reference position (m)', 'Couple RG ouvrture min', 'Couple RG ouvrture max',
								  'Couple RG ouvrture mean',
								  'Couple RD ouvrture min', 'Couple RD ouvrture max', 'Couple RD ouvrture mean',
				list_y1_values = list_x1_values[1:]
				list_x1 = ['Position (m)']
				list_x1_values = ['Position (m)',
								  'Effort vsup RG ouvr min', 'Effort vsup RG ouvr max',
								  'Effort vsup RG ouvr mean', 'Effort vsup RD ouvr min',
								  'Effort vsup RD ouvr max', 'Effort vsup RD ouvr mean',
				list_y1_values = list_x1_values[1:]
			list_x1_keys = list_x1 + df_eff_graph1.columns.to_list()
			list_y1_keys = df_eff_graph1.columns

		list_x1 = dict(zip(list_x1_keys, list_x1_values))
		list_y1 = dict(zip(list_y1_keys, list_y1_values))

		def dict_x_to_func(x):
			return list_x1[x]

		def dict_y_to_func(x):
			return list_y1[x]

		axe_x1 = col1.selectbox('Axe X:', list_x1_keys, format_func=dict_x_to_func)
		axe_y1 = col1.multiselect('Axe Y:', list_y1_keys, format_func=dict_y_to_func)

		str_axe_x1 = axe_x1.replace('_', ' ')
		titleX_graph1 = f'{str_axe_x1}'
		str_axe_Y1 = ', '.join(axe_y1)
		str_axe_Y1 = str_axe_Y1.replace('_', ' ')
		titleY_graph1 = f'{str_axe_Y1}'

		submit_graph1 = col1.form_submit_button('Submit axes')

		if submit_graph1 or state.submit_graph1:
			state.submit_graph1 = True

			print('the part when data are prepared and graph is displayed after pressing Submit')