Skip to content

Unable to close modal after click on datepicker. #2101

Discussion options

You must be logged in to vote

I copied your code, remove everything that I didn't have access to / variables I didn't have and the datepicker modal is working fine for me. It opens and closes when it should.

the code I used

"use client";

import { useEffect, useState } from "react";
import { Datepicker, Input, initTE } from "tw-elements";

const MyDatepicker = () => {
  const [isModalOpen, setModalOpen] = useState(false);

  const handleOkButtonClick = () => {
    setModalOpen(false); // Close the modal
  };

  const handleCancelButtonClick = () => {
    setModalOpen(false); // Close the modal
  };

  useEffect(() => {
    initTE({ Datepicker, Input });
  }, []);

  return (
    <>
      <fieldset className={`flex w-f…

Replies: 3 comments 25 replies

Comment options

You must be logged in to vote
2 replies
@julien
Comment options

@DanielApt
Comment options

Comment options

You must be logged in to vote
12 replies
@Bishalsnghd07
Comment options

@juujisai
Comment options

@Bishalsnghd07
Comment options

@juujisai
Comment options

Answer selected by Bishalsnghd07
@Bishalsnghd07
Comment options

@Bishalsnghd07
Comment options

@juujisai
Comment options

Comment options

You must be logged in to vote
11 replies
@Bishalsnghd07
Comment options

@juujisai
Comment options

@Bishalsnghd07
Comment options

@Bishalsnghd07
Comment options

@juujisai
Comment options

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