Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zebra_DatePicker instance doesn't add container on .update() #166

Closed
betheymc opened this issue Oct 26, 2020 · 6 comments
Closed

Zebra_DatePicker instance doesn't add container on .update() #166

betheymc opened this issue Oct 26, 2020 · 6 comments

Comments

@betheymc
Copy link
Contributor

When I try to add a container to a datepicker instance on .update(), the datepicker is still not added into the container, but on the $('body') element.

Here's basically what I did:

var el = $('input#datepicker');
var inst = el.data('Zebra_DatePicker');
$('<div class="zebra-datepicker-div"></div>').insertAfter(el);

// set the position of the container
el.siblings('.zebra-datepicker-div').first().css({'width': '300px', 'height': '300px', 'top': '1217px', 'left': '803.5px'});

// update datepicker to be in container
inst.update({container: $(el).siblings('.zebra-datepicker-div').first()});
@stefangabos
Copy link
Owner

that's not something i thought about - i always felt like the container should be known upfront so updating the container does nothing. but fair point i am now looking into it

@stefangabos
Copy link
Owner

should be fixed, please have a look

@stefangabos
Copy link
Owner

have you had the chance to test this?

@betheymc
Copy link
Contributor Author

@stefangabos sorry I haven't got back with you yet, been super busy at work. I found a workaround, so haven't yet had a chance to test. I will plan to do that in the near future and let you know how it goes.

@stefangabos stefangabos reopened this Nov 12, 2020
@stefangabos
Copy link
Owner

ok, thanks!

@betheymc
Copy link
Contributor Author

betheymc commented Dec 16, 2020

@stefangabos Just tested this, and it works! I think anyone updating the container should be sure to position the datepicker correctly so that it will actually visually go inside the container, but the datepicker html definitely shows up inside the container now on update. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants