Topic: MDB-TimePicker Disable

Aroquiassamy LA ROZE priority asked 2 years ago

Expected behavior Want to know how to disable timepicker

Actual behavior while disabling timepicker end up error as

*It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. We recommend using this approach to avoid 'changed after checked' errors. *

Resources (screenshots, code snippets etc.) chrome console log![][1]

akrolis pro answered 2 years ago

It's not pretty, but this workaround works for me:


<form [formGroup]="TimeForm">
 <div class="md-form">
<label for="form1">Example label</label>
<mdb-timepicker #timepicker></mdb-timepicker>


TimeForm: FormGroup;
ngOnInit() {
this.TimeForm = new FormGroup({
  timeinput: new FormControl(null)


get input() { return this.TimeForm.get('timeinput'); }

Arkadiusz Idzikowski staff answered 2 years ago

@Aroquiassamy LA ROZE This feature is currently not available in the timepicker component. We will take a closer look and add a fix.

This message is only a warning and it should not break your app compilation.


We made some tests and it looks like everything is working correctly. Please make sure that you added mdbInput directive to the input element. This directive allows using [disabled] input and blocking the input control using reactive forms (recommended in this case):

For example:

this.TimeForm = new FormGroup({
  timeinput: new FormControl({ value: null, disabled: true })

Arkadiusz Idzikowski staff commented 2 years ago

@Aroquiassamy LA ROZE @akrolis We checked everything and it looks like this feature is working without a problem when you use the correct syntax. Please see my edited answer.

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB4 9.4.0
  • Device: Lenovo Ideapad Gaming 3
  • Browser: Chrome,Edge
  • OS: Windows OS 10
  • Provided sample code: No
  • Provided link: No