domino-ui icon indicating copy to clipboard operation
domino-ui copied to clipboard

Disabling DataTable does not work

Open jhickman opened this issue 2 years ago • 1 comments

Disabling a DataTable only adds the "disabled" attribute and CSS class to the element, but doesn't actually disable interactions within the table.

Expected behavior When disabling a DataTable, all interactions should be disabled, including column sorting, filtering, cell editing, checkbox selection model, etc. Disabling should also prevent tabbing into cells.

jhickman avatar Aug 26 '22 17:08 jhickman

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled

The disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea>, and <input>.

For a quick fix, I wrapped my datatable in a <fieldset> and disabled it instead. This prevented any child elements (other than form controls in a <legend>) receive focus. I also had to lay on top a 'before' psuedo element to prevent clicking and gray it out.

jhickman avatar Aug 26 '22 17:08 jhickman