Skip to content

Conversation

@JorFlux
Copy link

@JorFlux JorFlux commented Dec 14, 2025

  • Added searchable boolean property to route options
  • Added navigationBarToolbarStyle property to control navigation bar toolbar visibility ('automatic' | 'hidden' | 'visible')
  • Added onSearchTextChange callback that fires when search text changes
  • Added onSearchFocusChange callback that fires when search field gains/loses focus
  • Created RepresentableViewController wrapper to properly integrate UIViewController with SwiftUI NavigationView (required for searchable functionality)
  • Updated iOS implementation to conditionally wrap searchable tabs in NavigationView and apply .searchable() modifier
  • Added support for both direct TabView usage and React Navigation integration

How to test?

  1. Using TabView directly:

    <TabView
      navigationState={{ index, routes }}
      onIndexChange={setIndex}
      renderScene={renderScene}
      onSearchTextChange={(text) => console.log('Search text:', text)}
      onSearchFocusChange={(isFocused) => console.log('Search focused:', isFocused)}
    />
    
    // In your routes:
    {
      key: 'contacts',
      title: 'Contacts',
      searchable: true,
      navigationBarToolbarStyle: 'visible', // or 'hidden' or 'automatic'
    }
  2. Using React Navigation:

    <Tab.Navigator
      onSearchTextChange={(text) => console.log('Search text:', text)}
      onSearchFocusChange={(isFocused) =>
        console.log('Search focused:', isFocused)
      }
    >
      <Tab.Screen
        name="Contacts"
        component={ContactsScreen}
        options={{
          searchable: true,
          navigationBarToolbarStyle: 'visible',
        }}
      />
    </Tab.Navigator>

Screenshots

For iOS 26 and higher
截圖 2025-12-14 下午4 03 27
For iOS 18
截圖 2025-12-14 下午4 04 53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant