My FeedDiscussionsHeadless
Sign in
Log inSign up

Default disabled button click event is not firing on reactjs

Sivabalan's photo
·Apr 25, 2018

I have button which by default was disabled. But when the checkbox was selected, button will be enabled, using ref i am enabling the button. After the button activated click event is not firing. Without the default disable, button's click event was firing.

                className="btn btn-danger" 
                ref={element => {
                    this.actionButtonRef = element;
                onClick={event => {

            <th key="checkboxall">
                    ref={element => {
                        this.checkboxAllRef = element;
                    onChange={event => this.onChangeCheckBox(event)}/>

onChangeCheckBox(event) {
    if( {
        this.actionButtonRef.disabled = "";
  else {
        this.actionButtonRef.disabled = "disabled";
  } }

Here is the jsfiddle

If anything i did wrong means, let me help guys