Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

add disabled option #191

Open
erdinc opened this issue Jul 14, 2016 · 2 comments
Open

add disabled option #191

erdinc opened this issue Jul 14, 2016 · 2 comments

Comments

@erdinc
Copy link

erdinc commented Jul 14, 2016

Can we add attribute like disabled={true} ?

@marlon407
Copy link

+1

@relacsua
Copy link

relacsua commented Dec 8, 2016

If you want to control the disabled state of this input, a simple manipulation of the DOM element using ref did the job for me.

For example:

<DateTimePicker
  ...
  ref={(dateRef) => {
  if (!disabled) {
    return;
  }
  const dateTimePicker = dateRef && dateRef.refs && dateRef.refs.datetimepicker;
  if (dateTimePicker) {
    for (const domElem of dateTimePicker.childNodes) {
      if (domElem.tagName === 'INPUT' &&  domElem.className === 'form-control') {
          domElem.disabled = true;
      }
    }
  }
}}/>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants