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

Datepicker calendar positioned incorrectly when options.controls set to FALSE #139

Open
gtasker10 opened this issue Mar 2, 2023 · 0 comments

Comments

@gtasker10
Copy link

When the option to hide the datepicker's controls is false, the calculations in the open() function to determine where the calendar should be shown are being done before the 'jcalendar-hide-controls' class is added to the container. This causes the calendar to appear with a large cap between the calendar and the control it is associated with when the calendar is shown above the control. IT also affects the calculations to determine whether the control should appear above or below the control so it will be visible on the screen.

The code to add that class must be moved to be before calling open() to show the calendar:

        // Controls
        if (obj.options.controls == false) {
            calendarContainer.classList.add('jcalendar-hide-controls');
        }

        // Default opened
        if (obj.options.opened == true) {
            obj.open();
        }
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

1 participant