datepicker closes side-panel overlay

1 reply · opened Aug 16, 2017

CchristophdbAug 16, 2017

Hi everybody,

I am using the side-panel (http://themes.semicolonweb.com/html/canvas/side-panel.php) to offer my customers a input form.
In this input form I like to use a datepicker (http://themes.semicolonweb.com/html/canvas/component-datepicker.php).

So my code looks like:


	[](#)
	

		
		

				from: 

Now I have the problem that as soon as I select a value with the datepicker the side-panel closes. I am close to a fix, but I think my solutions are very dirty:

  1. datepicker inside side-panel
    the datepicker container is not created inside the side-panel div. Therefore if I click anywhere of the datepicker box, it is a click outside side-panel and the side-panel closes. So I change the code inside datepicker.js:

show: function(){
	if (!this.isInline)
		//this.picker.appendTo('body');
		this.picker.appendTo('#form-overlay');

Due to this change from body to #form-overlay the container for the datepicker is created inside and so a click does not close the side-panel.

  1. second hack of datepicker
    Inside the function "_setDate: function(date, which){" I commented the line "fill()".
    Now as soon as I select a date the datepicker box keeps open and I can close it by click besides the boxes.

These two dirty hacks make it possible to use a datepicker inside a side-panel. But I would like to make the datepicker box close automatically as soon as I select a date. But the side-panel should stay open.

But I assume that there might be a more simple or elegant solution.
Can you assist me finding this solution?

Best regards
Christoph

SSemicolon WebSTAFFAug 18, 2017

Hello,

Thanks for your Patience! We can surely help you out with this issue, but before that it would be great if you can provide us with the Live URL so that we can check out the exact error and provide you with a more accurate codes for this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard