Topic: How to disable a MDBDatepicker in react ?

WingedImagination priority asked 1 year ago


Hi,

How to disable a MDBDatepicker in react ?


Krzysztof Wilk staff answered 1 year ago


Hi!

It seems there's a problem with that, we have to check it on our side. For now, you can try using this workaround in CSS, hope it'll meet your expectations :)

.datepicker,
.datepicker-toggle-button {
  pointer-events: none;
}

WingedImagination priority answered 1 year ago


Hi!

Thank you for your response. Unfortunately, using your method only causes the field to be grayed out. You can still change the date via the icon. Is there any way to disable MDBDatepicker ?


Krzysztof Wilk staff answered 1 year ago


Hi!

You can use an inputProps property to pass a readOnly one to the input. So it should look like:

<MDBDatepicker inputProps={{ readOnly: true }} />.

Keep coding!



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 3.0.0
  • Device: Macbook pro
  • Browser: Google Chrome
  • OS: macOS
  • Provided sample code: No
  • Provided link: No