Topic: How to disable a MDBDatepicker in react ?
WingedImagination priority asked 2 years ago
Hi,
How to disable a MDBDatepicker in react ?
Krzysztof Wilk staff answered 2 years 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 2 years 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 2 years 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!
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- 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