Changed boolean to event, to execute in Mendix
This commit is contained in:
BIN
dist/1.0.0/incentro.Backhandler.mpk
vendored
BIN
dist/1.0.0/incentro.Backhandler.mpk
vendored
Binary file not shown.
13
dist/tmp/widgets/Backhandler.xml
vendored
13
dist/tmp/widgets/Backhandler.xml
vendored
@@ -7,14 +7,11 @@
|
||||
<description>Disregard back events on page</description>
|
||||
<icon/>
|
||||
<properties>
|
||||
<propertyGroup caption="General">
|
||||
<property key="disableBack" type="attribute" required="true">
|
||||
<caption>Disable</caption>
|
||||
<description>Boolean for enabling/disabling backhandler</description>
|
||||
<attributeTypes>
|
||||
<attributeType name="Boolean"/>
|
||||
</attributeTypes>
|
||||
<propertyGroup caption="Events">
|
||||
<property key="onBack" type="action" required="false">
|
||||
<caption>On backpress</caption>
|
||||
<description>Flow to call when hardware backbutton is used.</description>
|
||||
</property>
|
||||
</propertyGroup>
|
||||
</propertyGroup>
|
||||
</properties>
|
||||
</widget>
|
||||
|
||||
@@ -112,14 +112,14 @@ class Backhandler extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
||||
return (Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], null));
|
||||
}
|
||||
componentWillMount() {
|
||||
if (this.props.disableBack) {
|
||||
react_native__WEBPACK_IMPORTED_MODULE_1__["BackHandler"].addEventListener('hardwareBackPress', this.handleBackButtonClick);
|
||||
}
|
||||
react_native__WEBPACK_IMPORTED_MODULE_1__["BackHandler"].addEventListener('hardwareBackPress', this.handleBackButtonClick);
|
||||
}
|
||||
componentWillUnmount() {
|
||||
react_native__WEBPACK_IMPORTED_MODULE_1__["BackHandler"].removeEventListener('hardwareBackPress', this.handleBackButtonClick);
|
||||
}
|
||||
handleBackButtonClick() {
|
||||
var _a;
|
||||
(_a = this.props.onBack) === null || _a === void 0 ? void 0 : _a.execute();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user