Compare commits

...
3 Commits
Author SHA1 Message Date
github-actions[bot] 9dd71637bb chore(master): release 4.1.1 (#333)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-25 16:46:44 +01:00
David Prevost b7e050c9ab fix: Removal of BackHandler.removeEventListener in react-native (#339) 2025-02-21 12:50:07 +01:00
Stephen Tuso 1ce802b8f0 fix: show touch feedback on iOS when using custom action sheet (#329) 2024-12-16 10:48:21 +01:00
4 changed files with 23 additions and 8 deletions

No files matched your search

+8
View File
@@ -1,5 +1,13 @@
# Changelog
## [4.1.1](https://github.com/expo/react-native-action-sheet/compare/v4.1.0...v4.1.1) (2025-02-21)
### Bug Fixes
* Removal of `BackHandler.removeEventListener` in react-native ([#339](https://github.com/expo/react-native-action-sheet/issues/339)) ([b7e050c](https://github.com/expo/react-native-action-sheet/commit/b7e050c9abab17b9a3ac21afed5bc73cecbecd6d))
* show touch feedback on iOS when using custom action sheet ([#329](https://github.com/expo/react-native-action-sheet/issues/329)) ([1ce802b](https://github.com/expo/react-native-action-sheet/commit/1ce802b8f095f9c553002dd84cae694a30c2dc01))
## [4.1.0](https://github.com/expo/react-native-action-sheet/compare/v4.0.1...v4.1.0) (2024-05-15)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@expo/react-native-action-sheet",
"version": "4.1.0",
"version": "4.1.1",
"description": "A cross-platform ActionSheet for React Native",
"react-native": "lib/module/index.js",
"types": "lib/typescript/index.d.ts",
+11 -4
View File
@@ -4,6 +4,7 @@ import {
BackHandler,
Easing,
Modal,
NativeEventSubscription,
Platform,
StyleSheet,
TouchableWithoutFeedback,
@@ -38,6 +39,7 @@ const ESCAPE_KEY = 'Escape';
// Has same API as https://facebook.github.io/react-native/docs/actionsheetios.html
export default class CustomActionSheet extends React.Component<Props, State> {
_actionSheetHeight = 360;
_backHandlerListener: NativeEventSubscription | undefined;
state: State = {
isVisible: false,
@@ -227,8 +229,12 @@ export default class CustomActionSheet extends React.Component<Props, State> {
this._deferAfterAnimation = undefined;
}
});
// @ts-ignore: Argument of type '"actionSheetHardwareBackPress"' is not assignable to parameter of type '"hardwareBackPress"'
BackHandler.addEventListener('actionSheetHardwareBackPress', this._selectCancelButton);
this._backHandlerListener = BackHandler.addEventListener(
// @ts-ignore: Argument of type '"actionSheetHardwareBackPress"' is not assignable to parameter of type '"hardwareBackPress"'
'actionSheetHardwareBackPress',
this._selectCancelButton
);
};
_selectCancelButton = () => {
@@ -269,8 +275,9 @@ export default class CustomActionSheet extends React.Component<Props, State> {
return false;
}
// @ts-ignore: Argument of type '"actionSheetHardwareBackPress"' is not assignable to parameter of type '"hardwareBackPress"'
BackHandler.removeEventListener('actionSheetHardwareBackPress', this._selectCancelButton);
if (this._backHandlerListener) {
this._backHandlerListener.remove();
}
this.setState({
isAnimating: true,
});
@@ -7,7 +7,7 @@ import {
TouchableWithoutFeedbackProps,
} from 'react-native';
// This TouchableOpacity has the same staic method of TouchableNativeFeedback
// This TouchableOpacity has the same static method of TouchableNativeFeedback
class CustomTouchableOpacity extends React.Component {
static SelectableBackground = () => ({});
static SelectableBackgroundBorderless = () => ({});
@@ -19,8 +19,8 @@ class CustomTouchableOpacity extends React.Component {
}
const TouchableComponent = Platform.select({
web: CustomTouchableOpacity,
default: Platform.Version <= 20 ? CustomTouchableOpacity : TouchableNativeFeedback,
default: CustomTouchableOpacity,
android: Platform.Version <= 20 ? CustomTouchableOpacity : TouchableNativeFeedback,
});
type Props = TouchableWithoutFeedbackProps & {