diff --git a/app/javascript/application.js b/app/javascript/application.js index 68bb153..2cb6515 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -134,13 +134,9 @@ window.detailsObserver = new MutationObserver((mutations) => { function readoutUnitChanged(select) { var button = select.closest('tr').querySelector('.set-default-unit'); if (select.value && select.value !== select.dataset.defaultUnitId) { - button.removeAttribute('disabled'); - button.removeAttribute('aria-disabled'); - button.removeAttribute('tabindex'); + Turbo.StreamElement.prototype.enableElement(button); } else { - button.setAttribute('disabled', 'disabled'); - button.setAttribute('aria-disabled', 'true'); - button.setAttribute('tabindex', '-1'); + Turbo.StreamElement.prototype.disableElement(button); } } window.readoutUnitChanged = readoutUnitChanged