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

Upgrade to tailwinds v4 #307

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

John4E656F
Copy link

@John4E656F John4E656F commented Feb 14, 2025

Fix for a bug where the popup doesn't appear with latest tailwinds version v4.

How i fixed this on src/components/icons/Input.tsx
function showCalendarContainer
one line 253 change div.classList.add("opacity-1"); -> div.classList.add("opacity-100");

   function showCalendarContainer() {
        if (arrow && div && div.classList.contains("hidden")) {
            div.classList.remove("hidden");
            div.classList.add("block");
            // window.innerWidth === 767
            const popoverOnUp = popoverDirection == "up";
            const popoverOnDown = popoverDirection === "down";
            if (
                popoverOnUp ||
                (window.innerWidth > 767 &&
                    window.screen.height - 100 < div.getBoundingClientRect().bottom &&
                    !popoverOnDown)
            ) {
                div.classList.add("bottom-full");
                div.classList.add("mb-2.5");
                div.classList.remove("mt-2.5");
                arrow.classList.add("-bottom-2");
                arrow.classList.add("border-r");
                arrow.classList.add("border-b");
                arrow.classList.remove("border-l");
                arrow.classList.remove("border-t");
            }
            setTimeout(() => {
                div.classList.remove("translate-y-4");
                div.classList.remove("opacity-0");
                div.classList.add("translate-y-0");
                div.classList.add("opacity-100");
            }, 1);
        }
    }

This was referenced Feb 14, 2025
@Alex-ley-scrub
Copy link

This also works as a quick and dirty workaround until this PR merges and a new version of the package gets released:

.opacity-1 {
    /* https://github.com/onesine/react-tailwindcss-datepicker/pull/307 */
    @apply opacity-100;
}

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

Successfully merging this pull request may close these issues.

2 participants