#111075Add a disabled state to generic buttons and pseudo button elements
Description
Problem
A button of the document header cannot be shown disabled when it is a custom element.
GenericButtonhas no disabled state at all. UnlikeLinkButton, which rendersaria-disabled="true"and the classdisabled, it has nosetDisabled().- The custom elements that act as a button and extend
PseudoButtonLitElement(e.g.typo3-qrcode-modal-button,typo3-copy-to-clipboard) ignore the attributedisabled. They stay in the tab order and are activated by a click,EnterandSpace. The attribute has no effect on a custom element that is not form-associated, and.btn:disableddoes not match it either. typo3-backend-sidebar-toggleandtypo3-backend-bookmark-buttoneach work around this on their own by settingaria-disabledand the tab index.
Proposal
GenericButton::setDisabled()renders the attributedisabled, and for a tag other than<button>the classdisabledfor the styles.PseudoButtonLitElementgets a reflected propertydisabled. While it is set, the element behaves as a disabled<button>: no activation by a click,EnterorSpace,tabindex="-1"andaria-disabled="true". A tab index set in the markup stays while the element was never disabled.- The sidebar toggle inherits this instead of doing it on its own.
The element leaves the tab order as a disabled <button> does. #104121 discusses the opposite for the bookmark button (focusable while disabled); its review (change 86111) ended undecided, with a preference for the real disabled state. With the state in one place, a later decision there applies to every pseudo button at once.
Use case
The Preview module keeps its document header without a preview (no page selected, a folder, no site) and shows the language selector, the view button and the QR code button disabled. The QR code button is a GenericButton rendering typo3-qrcode-modal-button.
Reviews 2
History 28
-
Benjamin Kott changed tracker
FeatureTask TYPO3 Version 14 <span data-processor="relativetime" data-value="2026-10-15T09:54:50+00:00" > 10/15/26, 09:54 </span> -
Gerrit Code Review pushed patch set 1 for main to change 96715 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-15T11:46:14+00:00" > 10/15/26, 11:46 </span> -
Gerrit Code Review pushed patch set 2 for main to change 96715 <span data-processor="relativetime" data-value="2026-10-15T13:26:55+00:00" > 10/15/26, 13:26 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 96715 <span data-processor="relativetime" data-value="2026-10-15T13:39:36+00:00" > 10/15/26, 13:39 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96723 <span data-processor="relativetime" data-value="2026-10-15T14:13:24+00:00" > 10/15/26, 14:13 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 96723 <span data-processor="relativetime" data-value="2026-10-15T14:42:38+00:00" > 10/15/26, 14:42 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 96715 <span data-processor="relativetime" data-value="2026-10-15T14:43:23+00:00" > 10/15/26, 14:43 </span>
-
Benjamin Kott commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-15T15:05:14+00:00" > 10/15/26, 15:05 </span>
Applied in changeset commit:1689529cd4494c9d9199238d0e302efd92a823bb.