3

I feel dirty even asking this question. But here it is:

I am using jqxGrid from jqWidgets. It adds tabindex="1" automatically to its grid. No mater what.

And it puts it back if you so much as mouse over the thing.

Crazy stuff. I am hoping that there is a way to remove it, but I found a jqWidgets question asked about this 4 years ago and it got no responses.

I know it will probably kill performance (and frankly I will probably not use it). But my frustration has me asking anyway...

Is there an event I can catch, so I know when tabindex is added to a specific element (and then remove it)? (or even better block it)

Vaccano
  • 78,325
  • 149
  • 468
  • 850
  • Uhh, this *is* dirty. I like it. What sort of browser support do you need? – vzwick Dec 21 '17 at 01:48
  • Also, let me get ahead of your response and point you straight to this: https://stackoverflow.com/questions/3219758/detect-changes-in-the-dom - tl;dr: `MutationObserver` – vzwick Dec 21 '17 at 01:52
  • @vzwick - ie 11. But now that the rage is clearing a bit (I am done with work for the day), I am less inclined actually to do something like this. But I am still wanting to know just in case. – Vaccano Dec 21 '17 at 01:58
  • Yeah, the "I want it to be perfect, although no one will ever notice" rabbit hole is all too easy to fall into ... – vzwick Dec 21 '17 at 02:05
  • So, I was bored (and it seemed a fun problem to work through), it does seem to work on IE 11 (though it - wrongly? - complains about a missing `;`): https://jsfiddle.net/davidThomas/6gbLk313/1/ – David Thomas Dec 21 '17 at 02:13

1 Answers1

0

Assuming the MutationObserver approach mentioned above doesn't work out because of browser constraints (and/or because it is deprecated in Level 3), you can always fall back to the brute-force

window.setInterval(function(){
    $('#grid [tabindex]').removeAttr('tabindex');
}, 200);
vzwick
  • 11,008
  • 5
  • 43
  • 63