mirror of
https://github.com/expo/react-native-action-sheet.git
synced 2026-11-14 19:11:42 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dd71637bb | ||
|
|
b7e050c9ab | ||
|
|
1ce802b8f0 |
No files matched your search
@@ -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
@@ -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",
|
||||
|
||||
@@ -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 & {
|
||||
|
||||
Reference in new issue
Block a user