react-native-tip icon indicating copy to clipboard operation
react-native-tip copied to clipboard

The tip is misplaced when orientation changes

Open noway opened this issue 2 years ago • 3 comments

How to reproduce

  1. click tip
  2. close
  3. go from portrait to landscape
  4. click tip again
  5. the tip is misplaced

image

How do I make react-native-tip to properly handle orientation changes?

noway avatar Mar 17 '22 02:03 noway

I'm having the same issue. Any updates on this?

williangaspar avatar Sep 07 '22 17:09 williangaspar

I found this line inside utils.js is causing the issue: const { width: screenWidth, height: screenHeight } = Dimensions.get('window')

It only executes once and does not update when the orientation changes. Relocating this line to getTipPositionProps seems to fix the issue.

williangaspar avatar Sep 07 '22 19:09 williangaspar

Hey Gaspar thanks for sharing! I will take a look and fix that for you.

Em qua., 7 de set. de 2022 14:43, Gaspar @.***> escreveu:

I'm having the same issue. Any updates on this?

— Reply to this email directly, view it on GitHub https://github.com/MaiconGilton/react-native-tip/issues/6#issuecomment-1239693551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJGITJ52X56NW6C27CKI54LV5DH35ANCNFSM5Q5SMQHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MaiconGilton avatar Sep 07 '22 23:09 MaiconGilton