SteffeyDev / react-native-popover-view

A well-tested, adaptable, lightweight <Popover> component for react-native
MIT License
613 stars 92 forks source link

onCloseComplete not working #180

Open davidteejay opened 1 month ago

davidteejay commented 1 month ago

Describe the bug I'm trying to show multiple popovers, one after the other. I need the one showing to complete disappear before showing the other, so I'm trying to use the onCloseComplete prop. However, the function I pass into the prop is never called.

Device/Setup Info:

Debug Output


[2024-10-10T17:27:13.615Z] calculateRectFromRef - waiting for ref
 LOG  [2024-10-10T17:27:13.615Z] calculateRectFromRef - waiting for ref to move from: {"x":0,"y":0,"width":0,"height":0}
 LOG  {"SCROLL_HEIGHT": 437, "elementIdFromProps": "TICKER", "page": 0, "y": 68}
 LOG  [2024-10-10T17:27:14.776Z] calculateRectFromRef - calculated Rect: {"x":173.66666793823242,"y":68,"width":26.666656494140625,"height":24}
 LOG  [2024-10-10T17:27:15.567Z] setDefaultDisplayArea - newDisplayArea: {"x":0,"y":0,"width":402,"height":874}
 LOG  [2024-10-10T17:27:15.568Z] setDefaultDisplayArea - displayAreaOffset: {"x":0,"y":0}
 LOG  [2024-10-10T17:27:15.574Z] calculateRectFromRef - waiting for ref
 LOG  [2024-10-10T17:27:15.575Z] calculateRectFromRef - waiting for ref to move from: {"x":173.66666793823242,"y":68,"width":26.666656494140625,"height":24}
 LOG  [2024-10-10T17:27:15.607Z] measureContent - new requestedContentSize: {"width":354,"height":184} (used to be null)
 LOG  [2024-10-10T17:27:15.612Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:27:15.640Z] measureContent - new requestedContentSize: {"width":344.3333435058594,"height":206} (used to be {"width":354,"height":184})
 LOG  [2024-10-10T17:27:15.647Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:27:15.673Z] measureContent - new requestedContentSize: {"width":342.3333435058594,"height":206} (used to be {"width":344.3333435058594,"height":206})
 LOG  [2024-10-10T17:27:15.677Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:27:15.707Z] measureContent - new requestedContentSize: {"width":341.3333435058594,"height":206} (used to be {"width":342.3333435058594,"height":206})
 LOG  [2024-10-10T17:27:15.711Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:27:15.740Z] measureContent - Skipping, content size did not change
 LOG  [2024-10-10T17:27:15.824Z] handleChange - requestedContentSize: {"width":341.3333435058594,"height":206}
 LOG  [2024-10-10T17:27:15.824Z] handleChange - displayArea: {"x":0,"y":0,"width":402,"height":874}
 LOG  [2024-10-10T17:27:15.824Z] handleChange - fromRect: {"x":173.66666793823242,"y":68,"width":26.666656494140625,"height":24}
 LOG  [2024-10-10T17:27:15.824Z] handleChange - placement: "auto"
 LOG  [2024-10-10T17:27:15.827Z] computeAutoGeometry - displayArea: {"x":0,"y":0,"width":402,"height":874}
 LOG  [2024-10-10T17:27:15.827Z] computeAutoGeometry - fromRect: {"x":173.66666793823242,"y":68,"width":26.666656494140625,"height":24}
 LOG  [2024-10-10T17:27:15.828Z] computeAutoGeometry - List of available space: {"left":{"sizeAvailable":158.66666793823242,"sizeRequested":341.3333435058594,"fits":false,"extraSpace":-182.66667556762695},"right":{"sizeAvailable":186.66667556762695,"sizeRequested":341.3333435058594,"fits":false,"extraSpace":-154.66666793823242},"top":{"sizeAvailable":53,"sizeRequested":206,"fits":false,"extraSpace":-153},"bottom":{"sizeAvailable":767,"sizeRequested":206,"fits":true,"extraSpace":561}}
 LOG  [2024-10-10T17:27:15.828Z] computeAutoGeometry - Found best postition for placement: "bottom"
 LOG  [2024-10-10T17:27:15.829Z] computeGeometry - initial chosen geometry: {"popoverOrigin":{"x":16.333324432373047,"y":100},"anchorPoint":{"x":186.99999618530273,"y":100},"placement":"bottom","forcedContentSize":{"width":382,"height":764},"viewLargerThanDisplayArea":{"height":false,"width":false}}
 LOG  [2024-10-10T17:27:15.829Z] computeGeometry - final chosen geometry: {"popoverOrigin":{"x":16.333324432373047,"y":100},"anchorPoint":{"x":186.99999618530273,"y":100},"placement":"bottom","forcedContentSize":{"width":382,"height":764},"viewLargerThanDisplayArea":{"height":false,"width":false}}
 LOG  [2024-10-10T17:27:15.839Z] handleChange - animating in
 LOG  [2024-10-10T17:27:15.840Z] getTranslateOrigin - popoverSize: {"width":341.3333435058594,"height":221}
 LOG  [2024-10-10T17:27:15.840Z] getTranslateOrigin - anchorPoint: {"x":186.99999618530273,"y":100}
 LOG  [2024-10-10T17:27:15.840Z] animateIn - translateStart: {"x":16.333324432373047,"y":1737.5}
 LOG  [2024-10-10T17:27:15.840Z] animateIn - translatePoint: {"x":16.333324432373047,"y":100}
 LOG  [2024-10-10T17:27:15.844Z] Setting up keyboard listeners
 LOG  [2024-10-10T17:27:15.873Z] measureContent - Skipping, content size did not change
 LOG  [2024-10-10T17:27:15.996Z] animateIn - onOpenComplete - Calculated Popover Rect: {"x":16.333324432373047,"y":115,"width":341,"height":206}
 LOG  [2024-10-10T17:27:15.997Z] animateIn - onOpenComplete - Calculated Arrow Rect: {"x":179.66665267944336,"y":100,"width":17,"height":17}
 LOG  [2024-10-10T17:28:12.621Z] componentWillUnmount
 LOG  [2024-10-10T17:28:12.621Z] animateOut - isMounted
 LOG  [2024-10-10T17:28:12.621Z] getTranslateOrigin - popoverSize: {"width":341.3333435058594,"height":221}
 LOG  [2024-10-10T17:28:12.621Z] getTranslateOrigin - anchorPoint: {"x":186.99999618530273,"y":100}
 LOG  [2024-10-10T17:28:13.288Z] Tearing down keyboard listeners
 LOG  [2024-10-10T17:28:13.897Z] calculateRectFromRef - waiting for ref
 LOG  [2024-10-10T17:28:13.897Z] calculateRectFromRef - waiting for ref to move from: {"x":0,"y":0,"width":0,"height":0}
 LOG  [2024-10-10T17:28:15.109Z] calculateRectFromRef - calculated Rect: {"x":16,"y":182,"width":107.66666412353516,"height":44}
 LOG  [2024-10-10T17:28:15.131Z] setDefaultDisplayArea - newDisplayArea: {"x":0,"y":0,"width":402,"height":874}
 LOG  [2024-10-10T17:28:15.131Z] setDefaultDisplayArea - displayAreaOffset: {"x":0,"y":0}
 LOG  [2024-10-10T17:28:15.138Z] calculateRectFromRef - waiting for ref
 LOG  [2024-10-10T17:28:15.138Z] calculateRectFromRef - waiting for ref to move from: {"x":16,"y":182,"width":107.66666412353516,"height":44}
 LOG  [2024-10-10T17:28:15.157Z] measureContent - new requestedContentSize: {"width":354,"height":184} (used to be null)
 LOG  [2024-10-10T17:28:15.161Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:28:15.190Z] measureContent - new requestedContentSize: {"width":346.6666564941406,"height":206} (used to be {"width":354,"height":184})
 LOG  [2024-10-10T17:28:15.194Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:28:15.224Z] measureContent - new requestedContentSize: {"width":344.6666564941406,"height":206} (used to be {"width":346.6666564941406,"height":206})
 LOG  [2024-10-10T17:28:15.228Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:28:15.257Z] measureContent - new requestedContentSize: {"width":343.6666564941406,"height":206} (used to be {"width":344.6666564941406,"height":206})
 LOG  [2024-10-10T17:28:15.263Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:28:15.290Z] measureContent - new requestedContentSize: {"width":343.3333435058594,"height":206} (used to be {"width":343.6666564941406,"height":206})
 LOG  [2024-10-10T17:28:15.295Z] handleChange - waiting 100ms to accumulate all changes
 LOG  [2024-10-10T17:28:15.324Z] measureContent - Skipping, content size did not change
 LOG  [2024-10-10T17:28:15.407Z] handleChange - requestedContentSize: {"width":343.3333435058594,"height":206}
 LOG  [2024-10-10T17:28:15.407Z] handleChange - displayArea: {"x":0,"y":0,"width":402,"height":874}
 LOG  [2024-10-10T17:28:15.407Z] handleChange - fromRect: {"x":16,"y":182,"width":107.66666412353516,"height":44}
 LOG  [2024-10-10T17:28:15.407Z] handleChange - placement: "auto"
 LOG  [2024-10-10T17:28:15.407Z] computeAutoGeometry - displayArea: {"x":0,"y":0,"width":402,"height":874}
 LOG  [2024-10-10T17:28:15.408Z] computeAutoGeometry - fromRect: {"x":16,"y":182,"width":107.66666412353516,"height":44}
 LOG  [2024-10-10T17:28:15.408Z] computeAutoGeometry - List of available space: {"left":{"sizeAvailable":1,"sizeRequested":343.3333435058594,"fits":false,"extraSpace":-342.3333435058594},"right":{"sizeAvailable":263.33333587646484,"sizeRequested":343.3333435058594,"fits":false,"extraSpace":-80.00000762939453},"top":{"sizeAvailable":167,"sizeRequested":206,"fits":false,"extraSpace":-39},"bottom":{"sizeAvailable":633,"sizeRequested":206,"fits":true,"extraSpace":427}}
 LOG  [2024-10-10T17:28:15.408Z] computeAutoGeometry - Found best postition for placement: "bottom"
 LOG  [2024-10-10T17:28:15.408Z] computeGeometry - initial chosen geometry: {"popoverOrigin":{"x":10,"y":234},"anchorPoint":{"x":69.83333206176758,"y":234},"placement":"bottom","forcedContentSize":{"width":382,"height":630},"viewLargerThanDisplayArea":{"height":false,"width":false}}
 LOG  [2024-10-10T17:28:15.408Z] computeGeometry - final chosen geometry: {"popoverOrigin":{"x":10,"y":234},"anchorPoint":{"x":69.83333206176758,"y":234},"placement":"bottom","forcedContentSize":{"width":382,"height":630},"viewLargerThanDisplayArea":{"height":false,"width":false}}
 LOG  [2024-10-10T17:28:15.414Z] handleChange - animating in
 LOG  [2024-10-10T17:28:15.414Z] getTranslateOrigin - popoverSize: {"width":343.3333435058594,"height":221}
 LOG  [2024-10-10T17:28:15.414Z] getTranslateOrigin - anchorPoint: {"x":69.83333206176758,"y":234}
 LOG  [2024-10-10T17:28:15.415Z] animateIn - translateStart: {"x":-101.83333969116211,"y":1871.5}
 LOG  [2024-10-10T17:28:15.415Z] animateIn - translatePoint: {"x":10,"y":234}
 LOG  [2024-10-10T17:28:15.422Z] Setting up keyboard listeners
 LOG  [2024-10-10T17:28:15.582Z] measureContent - Skipping, content size did not change
 LOG  [2024-10-10T17:28:15.582Z] animateIn - onOpenComplete - Calculated Popover Rect: {"x":10,"y":249,"width":343,"height":206}
 LOG  [2024-10-10T17:28:15.582Z] animateIn - onOpenComplete - Calculated Arrow Rect: {"x":62.33333206176758,"y":234,"width":17,"height":17}