Skip to content

Commit

Permalink
fix postitioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Mentos302 committed Oct 13, 2023
1 parent d88e7f7 commit c0ff35d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lendo-calendar",
"version": "1.6.10",
"version": "1.6.11",
"description": "A modern React Datepicker using Tailwind CSS 3",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
11 changes: 9 additions & 2 deletions src/components/Datepicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ const Datepicker: React.FC<DatepickerType> = ({
setTimeout(() => {
div.classList.remove("bottom-full");
div.classList.add("hidden");
window.innerWidth < 768 && div.classList.add("mb-2.5");
if (window.innerWidth < 768) {
div.classList.remove("mb-2.5"); // Removed margin-bottom on mobile
div.classList.remove("md:absolute");
div.classList.add("fixed");
} else {
div.classList.remove("fixed");
div.classList.add("md:absolute");
}
div.classList.add("mt-2.5");
arrow.classList.remove("-bottom-2");
arrow.classList.remove("border-r");
Expand Down Expand Up @@ -339,7 +346,7 @@ const Datepicker: React.FC<DatepickerType> = ({
<Input setContextRef={setInputRef} />

<div
className="fixed left-0 bottom-0 w-full m-0 md:absolute md:left-auto md:bottom-auto md:w-auto transition-all ease-out duration-300 z-10 mt-[1px] text-sm lg:text-xs 2xl:text-sm translate-y-4 opacity-0 hidden "
className="fixed left-0 bottom-0 w-full m-0 md:absolute md:left-auto md:bottom-auto md:w-auto transition-all ease-out duration-300 z-10 mt-[1px] text-sm lg:text-xs 2xl:text-sm translate-y-4 opacity-0 hidden"
ref={calendarContainerRef}
>
<Arrow ref={arrowRef} />
Expand Down
59 changes: 26 additions & 33 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
{
"compilerOptions": {
"target": "esnext",
"lib": [
"dom",
"esnext"
],
"module": "esnext",
"jsx": "preserve",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"baseUrl": "src/",
"declaration": true,
"outDir": "./dist",
"inlineSources": true,
"sourceMap": true,
"rootDir": "src",
"allowJs": true,
"skipLibCheck": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules"
]
"compilerOptions": {
"target": "esnext",
"lib": ["dom", "esnext"],
"module": "esnext",
"jsx": "preserve",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"baseUrl": "src/",
"declaration": true,
"outDir": "./dist",
"inlineSources": true,
"sourceMap": true,
"rootDir": "src",
"allowJs": true,
"skipLibCheck": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

0 comments on commit c0ff35d

Please sign in to comment.