treycarroll
Giga Guru

My company updated Chrome a couple of weeks ago.     When that update happened, users lost the ability to select the text in form elements if that element was marked as "disabled" in the HTML.     (Fields with readonly="readonly" were still selectable.)     Since essential fields like ticket numbers, that users routinely copy and paste into emails, became unselectable, this "small" annoyance actually caused quite a stir and some (wrongful) backlash against SNOW.

I have put a global UI Script in place (Geneva Patch 8 hotfix 1):

try{

  $j( document ).ready(function() {

        $j('input.form-control').removeAttr('disabled');//edited jQuery selector to reflect need to avoid select-type elements

} catch(e) {

  if(g_user.hasRole('admin')){

      alert(e.message);

  }

}

We've just started testing it.     I don't see any worrisome performance impacts from a cursory inspection.     I could have improved the specificity of the jQuery selector to also look for the disabled class attribute, but I was concerned about performance.

Please let me know if you have any issues with the same.

In the spirit of sharing,

Trey Carroll

4 Comments
sabell2012
Mega Sage
Mega Sage

Thanks Trey, good to know.


brittany_sorrel
Kilo Expert

Hi Trey,



We were testing removing the disabled attribute through the inspect element and removing it in the source to see what would happen. One of our devs found that for fields that were a drop-down the user could then modify the value and update the record, whereas reference fields remained read-only and the text could then be copied. Does your script apply to all field types or do only specific ones have form-control as part of their element?



Thanks,


Britt


treycarroll
Giga Guru

Hi Brittany,



Thank you for the feedback.     I confirmed that the code I provided above would cause the issue that you described with select elements, making them incorrectly accessible.



I have updated the code to the following:



try{


  $j( document ).ready(function() {


            $j('input.form-control').removeAttr('disabled');


  });


} catch(e) {


    if(g_user.hasRole('admin')){


            alert(e.message);


    }


}



This will now only operate on input-type elements, shielding select elements from becoming incorrectly editable.



Thanks,



Trey Carroll


Kalaiarasan Pus
Giga Sage

Thanks Trey. I was about to raise a HI ticket for this ...