From c5f41c299ff13eb671a3c0f604f53d6589e87572 Mon Sep 17 00:00:00 2001 From: woksin Date: Thu, 29 Oct 2026 15:16:37 +0100 Subject: [PATCH] Navigation toolbar buttons carry their title as an explicit aria-label --- .../when_a_topbar_hides_a_button_label.tsx | 1 + .../react/navigation/region/NavigationRegionView.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/JavaScript/react/for_NavigationRegionView/when_a_topbar_hides_a_button_label.tsx b/Source/JavaScript/react/for_NavigationRegionView/when_a_topbar_hides_a_button_label.tsx index 8f9be9d1..d5eb7afc 100644 --- a/Source/JavaScript/react/for_NavigationRegionView/when_a_topbar_hides_a_button_label.tsx +++ b/Source/JavaScript/react/for_NavigationRegionView/when_a_topbar_hides_a_button_label.tsx @@ -33,6 +33,7 @@ describe('when a topbar hides a button label', () => { const hideLabels = () => document.querySelectorAll('[data-scene-nav-button] > span:not([aria-hidden])').forEach(span => { span.style.display = 'none'; }); it('should give the button the title as its tooltip', () => button().getAttribute('title')!.should.equal('Register SKU')); + it('should give the button the title as its aria label', () => button().getAttribute('aria-label')!.should.equal('Register SKU')); it('should keep the button findable by the title when the label is hidden', () => { hideLabels(); (screen.getByRole('button', { name: 'Register SKU' }) === button()).should.equal(true); diff --git a/Source/JavaScript/react/navigation/region/NavigationRegionView.tsx b/Source/JavaScript/react/navigation/region/NavigationRegionView.tsx index 1404a005..a980710f 100644 --- a/Source/JavaScript/react/navigation/region/NavigationRegionView.tsx +++ b/Source/JavaScript/react/navigation/region/NavigationRegionView.tsx @@ -267,10 +267,10 @@ export function NavigationRegionView({ region, module, application = false, mode data-scene-nav-mode={resolved.mode} onKeyDown={onKeyDown}> {buttons.length > 0 &&
- {/* A compact topbar and a slim rail hide the label and show only the icon, so the button carries its title as the tooltip and accessible name. */} + {/* A compact topbar and a slim rail hide the label and show only the icon, so the button carries its title as the tooltip and as an explicit aria-label. */} {buttons.map(button => )}