Skip Navigation

[Resolved] Post form: Issue with dropdown of related posts in conditional field

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by David Gimenez 4 years, 3 months ago.

Assisted by: Jamal.

Author
Posts
#1760229
Captura de pantalla 2020-08-28 a las 13.18.47.png
Captura de pantalla 2020-08-28 a las 13.20.49.png
Captura de pantalla 2020-08-28 a las 13.18.23.png
Captura de pantalla 2020-08-28 a las 13.19.01.png

Hi there. I have an unexpected behaviour in a post form.

If the dropdown is in a conditional group, the dropdown doesn't render with 100% width (screenshots with number 1)
If the dropdown is not in a conditional group, it renders with 100% width (screenshots with number 2)

The dropdown load related posts.

Any idea why does it happen this?

I attach 4 screenshots

#1760461

Hello and thank you for contacting the Toolset support.

To better assist you with this issue, I'll need to analyze the generated HTML in both cases. The best way would be to allow me temporary access to your website and let me check this.
I'll need:
- To know what form is this?
- To know on what page/template this form is being used, so I can analyze it on the frontend?

Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1761205

Thank you for the credentials and the details. I can see the issue on the form "Formulari de creacio de vi"
It seems that the width of the dropdown is fixed on the browser side by Javascript code. I was not able to find the root cause yet.
As a workaround, I added the following custom code to the form and it seems to fix the issue.

jQuery(function($){
	setInterval(function(){
		jQuery('.toolset_select2').each(function(){
			var select = jQuery(this);
			if ( select.is(':visible')) {
				var parent = select.parent();
				if ( select.width() !== parent.width() ) {
					select.width( parent.width() );
				}
			}
		});
	}, 300);
});

This code should work for the second form too, but I did not test it on it.
I'll get back to you as soon as I found something else.

#1761275

My issue is resolved now. Thank you!