Skip to content

Commit 7a7c31c

Browse files
authored
fix(updateNavigationBar): revert from accesibilityLabel to name (#234)
closes #233
1 parent ec4379b commit 7a7c31c

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,9 @@ downloadBase64({
294294
295295
<kbd>App version >= 10.7: Partial support</kbd><br/> <kbd>App version >= 11.8:
296296
expandedTitle</kbd><br/> <kbd>App version >= 14.8: Additional properties and
297-
deprecations</kbd><br/> <kbd>App version >= 25.12: accessibilityLabel and
298-
isButton</kbd><br/> <kbd>Partial support in B2P App version <=24.10:
299-
title</kbd><br/> <kbd>Partial support in B2P App version >=24.11: right
300-
actions</kbd><br/>
297+
deprecations</kbd><br/> <kbd>App version >= 25.12: isButton</kbd><br/>
298+
<kbd>Partial support in B2P App version <=24.10: title</kbd><br/> <kbd>Partial
299+
support in B2P App version >=24.11: right actions</kbd><br/>
301300
302301
Customize WebView NavigationBar properties. You can set one or more properties
303302
in a single call
@@ -308,8 +307,11 @@ type NavigationBarIcon = {
308307
id: string;
309308
/** URL to be opened by the app as a deep-link if present */
310309
url?: string;
311-
/** @deprecated use 'accessibilityLabel' instead */
312-
name?: string;
310+
/**
311+
* Accessibility label for the icon. When isButton=true you should always set a name, when isButton=false if you don't want it to be
312+
* read by screen readers, then explicitly set it to an empty string.
313+
* */
314+
name: string;
313315
/** Accessibility label for the icon */
314316
accessibilityLabel?: string;
315317
/** default: true, set to false if the Icon is decorative */

src/__tests__/utils-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ test('update navigation bar, with options', (done) => {
144144
url: 'https://example.com/icon.png',
145145
urlDark: 'https://example.com/icon-dark.png',
146146
},
147-
accessibilityLabel: 'Left',
147+
name: 'Left',
148148
badge: {
149149
show: true,
150150
nativeLogic: 'INBOX',
@@ -157,7 +157,7 @@ test('update navigation bar, with options', (done) => {
157157
id: 'icon2',
158158
url: 'https://example.com/action2',
159159
iconEnum: 'SOME_ICON',
160-
accessibilityLabel: 'Right',
160+
name: 'Right',
161161
badge: {
162162
show: true,
163163
number: 1,
@@ -167,7 +167,7 @@ test('update navigation bar, with options', (done) => {
167167
{
168168
id: 'icon3',
169169
iconEnum: 'OTHER_ICON',
170-
accessibilityLabel: 'Right 2',
170+
name: 'Right 2',
171171
},
172172
],
173173
colorVariant: 'INVERSE',

src/utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ export type NavigationBarIcon = Readonly<{
4444
id: string;
4545
/** URL to be opened by the app as a deep-link if present */
4646
url?: string;
47-
/** @deprecated use 'accessibilityLabel' instead */
48-
name?: string;
49-
/** Accessibility label for the icon */
50-
accessibilityLabel?: string;
47+
/**
48+
* Accessibility label for the icon. When isButton=true you should always set a name, when isButton=false if you don't want it to be
49+
* read by screen readers, then explicitly set it to an empty string.
50+
* */
51+
name: string;
5152
/** default: true, set to false if the Icon is decorative */
5253
isButton?: boolean;
5354
/**

0 commit comments

Comments
 (0)