Skip to content

Commit

Permalink
Fix/change haptic feedback (#163)
Browse files Browse the repository at this point in the history
* fix: set hapticFeedback default to false

* docs(changeset): change hapticFeedbackEnabled to false by default
  • Loading branch information
okwasniewski authored Nov 27, 2024
1 parent af0c62a commit 2503e16
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-grapes-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-bottom-tabs': patch
---

change hapticFeedbackEnabled to false by default
2 changes: 1 addition & 1 deletion docs/docs/docs/guides/standalone-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Whether to disable animations between tabs.

Whether to enable haptic feedback on tab press.
- Type: `boolean`
- Default: `true`
- Default: `false`


#### `tabLabelStyle`
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docs/guides/usage-with-react-navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Tab views using the sidebar adaptable style have an appearance

#### `hapticFeedbackEnabled`

Whether to enable haptic feedback on tab press. Defaults to true.
Whether to enable haptic feedback on tab press. Defaults to false.

#### `tabLabelStyle`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ReactBottomNavigationView(context: Context) : BottomNavigationView(context
private var inactiveTintColor: Int? = null
private val checkedStateSet = intArrayOf(android.R.attr.state_checked)
private val uncheckedStateSet = intArrayOf(-android.R.attr.state_checked)
private var hapticFeedbackEnabled = true
private var hapticFeedbackEnabled = false
private var fontSize: Int? = null
private var fontFamily: String? = null
private var fontWeight: Int? = null
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-bottom-tabs/ios/TabViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TabViewProps: ObservableObject {
@Published var translucent: Bool = true
@Published var ignoresTopSafeArea: Bool = true
@Published var disablePageAnimations: Bool = false
@Published var hapticFeedbackEnabled: Bool = true
@Published var hapticFeedbackEnabled: Bool = false
@Published var fontSize: Int?
@Published var fontFamily: String?
@Published var fontWeight: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import SDWebImageSVGCoder
}
}

@objc public var hapticFeedbackEnabled: Bool = true {
@objc public var hapticFeedbackEnabled: Bool = false {
didSet {
props.hapticFeedbackEnabled = hapticFeedbackEnabled
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-bottom-tabs/src/TabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const TabView = <Route extends BaseRoute>({
barTintColor,
getHidden = ({ route }: { route: Route }) => route.hidden,
getActiveTintColor = ({ route }: { route: Route }) => route.activeTintColor,
hapticFeedbackEnabled = true,
hapticFeedbackEnabled = false,
tabLabelStyle,
...props
}: Props<Route>) => {
Expand Down

0 comments on commit 2503e16

Please sign in to comment.