Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/change haptic feedback #163

Merged
merged 2 commits into from
Nov 27, 2024
Merged
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/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 @@
barTintColor,
getHidden = ({ route }: { route: Route }) => route.hidden,
getActiveTintColor = ({ route }: { route: Route }) => route.activeTintColor,
hapticFeedbackEnabled = true,
hapticFeedbackEnabled = false,
tabLabelStyle,
...props
}: Props<Route>) => {
Expand Down Expand Up @@ -192,7 +192,7 @@

if (!loaded.includes(focusedKey)) {
// Set the current tab to be loaded if it was not loaded before
setLoaded((loaded) => [...loaded, focusedKey]);

Check warning on line 195 in packages/react-native-bottom-tabs/src/TabView.tsx

View workflow job for this annotation

GitHub Actions / lint

'loaded' is already declared in the upper scope on line 191 column 10
}

const icons = React.useMemo(
Expand Down
Loading