From 1f811231450347f9427d17e9d2d0659a2d6a42a9 Mon Sep 17 00:00:00 2001
From: Sven Liebig <9104499+svenliebig@users.noreply.github.com>
Date: Tue, 26 Aug 2025 11:29:55 +0200
Subject: [PATCH] [feat] Support title property for all elements
the `title` property is used in web for describing `` without
text (for example only icons), that is used additionally to the
`aria-label`. This is because the `aria-label` is only available for the
screen readers but not for the regular user, the title will also appear
for the regular user.
---
.../src/exports/Pressable/__tests__/index-test.js | 7 +++++++
.../react-native-web/src/modules/forwardedProps/index.js | 1 +
2 files changed, 8 insertions(+)
diff --git a/packages/react-native-web/src/exports/Pressable/__tests__/index-test.js b/packages/react-native-web/src/exports/Pressable/__tests__/index-test.js
index 21231c055f..632628b49f 100644
--- a/packages/react-native-web/src/exports/Pressable/__tests__/index-test.js
+++ b/packages/react-native-web/src/exports/Pressable/__tests__/index-test.js
@@ -342,4 +342,11 @@ describe('components/Pressable', () => {
expect(container.firstChild).toMatchSnapshot();
});
});
+
+ describe('prop "title"', () => {
+ test('value is set', () => {
+ const { container } = render();
+ expect(container.firstChild).toHaveProperty('title', '123');
+ });
+ });
});
diff --git a/packages/react-native-web/src/modules/forwardedProps/index.js b/packages/react-native-web/src/modules/forwardedProps/index.js
index bfb3104896..797b724246 100644
--- a/packages/react-native-web/src/modules/forwardedProps/index.js
+++ b/packages/react-native-web/src/modules/forwardedProps/index.js
@@ -16,6 +16,7 @@ export const defaultProps = {
suppressHydrationWarning: true,
tabIndex: true,
testID: true,
+ title: true,
// @deprecated
focusable: true,
nativeID: true