Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tidy-unicode-tabs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-bottom-tabs': patch
---

Fix an iOS Fabric crash when selecting or long-pressing a tab whose key contains non-ASCII characters.
19 changes: 19 additions & 0 deletions packages/example-shared/e2e/unicode-tab-key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
appId: ${APP_ID}
name: Press and long-press a tab with a Unicode key
---
- launchApp
- scrollUntilVisible:
element:
text: ^Native Bottom Tabs$
direction: DOWN
timeout: 15000
- tapOn:
text: ^Native Bottom Tabs$
- assertVisible: Press me
- tapOn:
text: ^Albums$
- longPressOn:
text: ^Albums$
- tapOn:
text: ^Chat$
- assertVisible: Press me
3 changes: 2 additions & 1 deletion packages/example-shared/src/Examples/NativeBottomTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ function NativeBottomTabs() {
}}
/>
<Tab.Screen
name="Albums"
name="앨범"
component={Albums}
options={{
tabBarButtonTestID: 'albumsTestID',
tabBarLabel: 'Albums',
Comment on lines +60 to +64

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a new example page for this called "Unicode" or something similar, so we don't pollute the old example. You can copy-paste this one.

tabBarIcon: () => require('../../assets/icons/grid_dark.png'),
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ - (void)onPageSelectedWithKey:(NSString *)key reactTag:(NSNumber *)reactTag {
auto eventEmitter = std::static_pointer_cast<const RNCTabViewEventEmitter>(_eventEmitter);
if (eventEmitter) {
eventEmitter->onPageSelected(RNCTabViewEventEmitter::OnPageSelected{
.key = [key cStringUsingEncoding:kCFStringEncodingUTF8]
.key = std::string([key UTF8String] ?: "")
});
}
}
Expand All @@ -274,7 +274,7 @@ - (void)onLongPressWithKey:(NSString *)key reactTag:(NSNumber *)reactTag {
auto eventEmitter = std::static_pointer_cast<const RNCTabViewEventEmitter>(_eventEmitter);
if (eventEmitter) {
eventEmitter->onTabLongPress(RNCTabViewEventEmitter::OnTabLongPress {
.key = [key cStringUsingEncoding:kCFStringEncodingUTF8]
.key = std::string([key UTF8String] ?: "")
});
}
}
Expand Down
Loading