about summary refs log tree commit diff
path: root/src/view/com/util/TabBar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/util/TabBar.tsx')
-rw-r--r--src/view/com/util/TabBar.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/view/com/util/TabBar.tsx b/src/view/com/util/TabBar.tsx
index d3fe54830..67c9276c6 100644
--- a/src/view/com/util/TabBar.tsx
+++ b/src/view/com/util/TabBar.tsx
@@ -21,6 +21,7 @@ export function TabBar({
   indicatorPosition = 'bottom',
   indicatorColor,
   onSelect,
+  onPressSelected,
 }: {
   selectedPage: number
   items: string[]
@@ -29,6 +30,7 @@ export function TabBar({
   indicatorPosition?: 'top' | 'bottom'
   indicatorColor?: string
   onSelect?: (index: number) => void
+  onPressSelected?: () => void
 }) {
   const pal = usePalette('default')
   const [itemLayouts, setItemLayouts] = useState<Layout[]>(
@@ -80,6 +82,9 @@ export function TabBar({
 
   const onPressItem = (index: number) => {
     onSelect?.(index)
+    if (index === selectedPage) {
+      onPressSelected?.()
+    }
   }
 
   return (