SteffeyDev / react-native-popover-view

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

Attempted to remove more RCTKeyboardObserver listeners than added. #74

Closed FarazzShaikh closed 4 years ago

FarazzShaikh commented 4 years ago

Describe the bug Application crashes with: Attempted to remove more RCTKeyboardObserver listeners than added after opening and closing the popover exactly 3 times and every subsequent time after refreshing view.

Device/Setup Info:

Screenshots Screenshot 2020-07-07 at 8 15 24 PM Simulator Screen Shot - iPad Pro (12 9-inch) (3rd generation) - 2020-07-07 at 20 22 12

Debug Output [2020-07-07T16:24:30.749Z] calculateRectFromRef - waiting for ref Popover.js:339 [2020-07-07T16:24:30.750Z] calculateRectFromRef - waiting for ref to move Popover.js:339 [2020-07-07T16:24:30.800Z] calculateRectFromRef - calculated Rect: {"x":340,"y":75,"width":312,"height":350} Popover.js:339 [2020-07-07T16:24:30.845Z] setDefaultDisplayArea - newDisplayArea: {"x":10,"y":34,"width":1346,"height":960} Popover.js:339 [2020-07-07T16:24:30.846Z] setDefaultDisplayArea - displayAreaOffset: {"x":0,"y":0} Popover.js:498 [2020-07-07T16:24:30.853Z] handleChange - no requestedContentSize, exiting... Popover.js:339 [2020-07-07T16:24:30.854Z] calculateRectFromRef - waiting for ref Popover.js:339 [2020-07-07T16:24:30.855Z] calculateRectFromRef - waiting for ref to move Popover.js:498 [2020-07-07T16:24:30.887Z] measureContent - new requestedContentSize: {"y":0,"width":300,"height":123,"x":0} (used to be null) Popover.js:498 [2020-07-07T16:24:30.891Z] handleChange - waiting 100ms to accumulate all changes Popover.js:339 [2020-07-07T16:24:30.898Z] setDefaultDisplayArea - newDisplayArea: {"x":10,"y":34,"width":1346,"height":980} Popover.js:339 [2020-07-07T16:24:30.899Z] setDefaultDisplayArea - displayAreaOffset: {"x":0,"y":0} Popover.js:498 [2020-07-07T16:24:30.905Z] handleChange - waiting 100ms to accumulate all changes Popover.js:339 [2020-07-07T16:24:30.906Z] calculateRectFromRef - waiting for ref Popover.js:339 [2020-07-07T16:24:30.906Z] calculateRectFromRef - waiting for ref to move Popover.js:339 [2020-07-07T16:24:30.917Z] setDefaultDisplayArea - newDisplayArea: {"x":10,"y":34,"width":1346,"height":960} Popover.js:339 [2020-07-07T16:24:30.918Z] setDefaultDisplayArea - displayAreaOffset: {"x":0,"y":0} Popover.js:498 [2020-07-07T16:24:30.922Z] handleChange - waiting 100ms to accumulate all changes Popover.js:339 [2020-07-07T16:24:30.922Z] calculateRectFromRef - waiting for ref Popover.js:339 [2020-07-07T16:24:30.923Z] calculateRectFromRef - waiting for ref to move Popover.js:498 [2020-07-07T16:24:31.032Z] handleChange - requestedContentSize: {"y":0,"width":300,"height":123,"x":0} Popover.js:498 [2020-07-07T16:24:31.034Z] handleChange - displayArea: {"x":10,"y":34,"width":1346,"height":960} Popover.js:498 [2020-07-07T16:24:31.035Z] handleChange - fromRect: {"x":340,"y":75,"width":312,"height":350} Popover.js:498 [2020-07-07T16:24:31.035Z] handleChange - placement: "auto" Popover.js:498 [2020-07-07T16:24:31.035Z] computeAutoGeometry - could fit on left side Popover.js:498 [2020-07-07T16:24:31.035Z] computeGeometry - initial chosen geometry: {"popoverOrigin":{"x":32,"y":188.5},"anchorPoint":{"x":340,"y":250},"placement":"left","forcedContentSize":{"height":960,"width":322},"viewLargerThanDisplayArea":{"height":false,"width":false}} Popover.js:498 [2020-07-07T16:24:31.035Z] computeGeometry - final chosen geometry: {"popoverOrigin":{"x":32,"y":188.5},"anchorPoint":{"x":340,"y":250},"placement":"left","forcedContentSize":{"height":960,"width":322},"viewLargerThanDisplayArea":{"height":false,"width":false}} Popover.js:498 [2020-07-07T16:24:31.040Z] handleChange - animating in Popover.js:498 [2020-07-07T16:24:31.041Z] getTranslateOrigin - popoverOrigin: {"x":32,"y":188.5} Popover.js:498 [2020-07-07T16:24:31.041Z] getTranslateOrigin - popoverSize: {"width":300,"height":123} Popover.js:498 [2020-07-07T16:24:31.042Z] getTranslateOrigin - anchorPoint: {"x":340,"y":250} Popover.js:498 [2020-07-07T16:24:31.042Z] getTranslateOrigin - shift: {"hoizontal":158,"vertical":0} Popover.js:339 [2020-07-07T16:24:31.054Z] Setting up keyboard listeners Popover.js:498 [2020-07-07T16:24:31.559Z] animateIn - onOpenComplete - Calculated Popover Rect: {"x":32,"y":188.5,"width":300,"height":123} Popover.js:498 [2020-07-07T16:24:31.571Z] animateIn - onOpenComplete - Calculated Arrow Rect: {"x":331,"y":241,"width":18,"height":18} Popover.js:498 [2020-07-07T16:24:32.249Z] getTranslateOrigin - popoverOrigin: {"x":32,"y":188.5} Popover.js:498 [2020-07-07T16:24:32.250Z] getTranslateOrigin - popoverSize: {"width":300,"height":123} Popover.js:498 [2020-07-07T16:24:32.250Z] getTranslateOrigin - anchorPoint: {"x":340,"y":250} Popover.js:498 [2020-07-07T16:24:32.251Z] getTranslateOrigin - shift: {"hoizontal":158,"vertical":0} Popover.js:339 [2020-07-07T16:24:32.317Z] Tearing down keyboard listeners

SteffeyDev commented 4 years ago

Thanks for the info, I can probably be more careful about only removing if confirmed added

SteffeyDev commented 4 years ago

There's a newer way to remove keyboard listeners, this should be fixed after the next release