Closed ugrky closed 4 years ago
I actually had a fix for #74 that I made a while ago, but forgot to push, sorry! Just deployed as 3.0.4. I'll let you test and either close this pull request or amend it if you find it necessary.
Hey Steffey, would be great if you do the new release. It's a neat code, and super useful! Thanks in advance! 🙂🙂🙂
I already released, should be up on NPM now
Hi, I am getting this issue on going back of screen instantly after closing the popover. Using latest version.
const popoverVisibility = bool => {
InteractionManager.runAfterInteractions(() => {
setShowPopover(bool);
});
};
<Popover
placement={PopoverPlacement.BOTTOM}
isVisible={showPopover}
onRequestClose={() => popoverVisibility(false)}
from={
<TouchableOpacity
onPress={() => popoverVisibility(true)}
style={styles.chipWrapper(true)}>
</TouchableOpacity>
}>
<View style={{padding: 8}}>
{propertyStatusData.map((v, i) => (
<TouchableOpacity
onPress={() => onPressPropertyStatus(v)}
</TouchableOpacity>
))}
</View>
</Popover>`
@Ajmal0197 Please open a new issue with the same information, and we can discuss it there
Issue This pull request fixes the following issue: #74 .
Cause of Issue In two distinct places, listeners assigned to
keyboardDidShowListener
andkeyboardDidHideListener
are attempted to be removed. These two logic are triggered before unmount right after each other, and defined in following places:In remove logic in
componentWillUnmount
is triggered beforeonCloseStart
. However, incomponentWillUnmount
, the listeners are not set back tonull
, sothis.keyboardDidShowListener &&
check inonCloseStart
returnstrue
, and we attempt to remove a non-existing listener.Fix
Added a similar logic that sets the listeners to
null
incomponentWillUnmount
:Additionally, typed the listeners properly: